The Big Ideas

Maciej Kaszubowski
Sep 12, 2018 · 4 min read

If you look at the history of Computer Science, you can see that there are few big ideas that keep emerging. Is there a lesson that we may learn from this?

Will Serverless Change the World?

Serverless is based on the idea of Function as a Service (FaaS). In this approach, you write your code as a set of short-lived functions, which are invoked after some event occurs. That’s it. You don’t have to care about how the code is actually invoked, you don’t have to care about where the code lives. You write the code and the runtime takes care of everything else. You get high availability, scalability, fault tolerance for free. That must be a novel idea, isn’t it?

The Other End Of Spectrum

So if you use Erlang (or Elixir), you might be skeptical about the Cloud and Serverless Computing movements. They favor using short-lived containers or even shorter-lived functions. Are you doing something wrong when using a platform that is designed with long-running systems in mind?

Do you know what is the most basic concept of Erlang/Elixir concurrency? It’s a process. Every piece of code you run in the Erlang VM is executed inside a process. The processes are really lightweight so you can spawn thousands or millions of them at the same time. They are also completely isolated from each other and share no memory. If you want to coordinate two processes, you have to do this by asynchronous message passing. The Erlang VM runs its own scheduler which controls when each process can execute its code.

Does it sound familiar?

An Erlang process runs its code in reaction to messages being sent to this process. The Erlang scheduler decides when each process is executed.

A function in FaaS is executed in reaction to some event. The runtime decides when each function executed.

The Idea

The companies which succeed in creating microservice-based systems are the ones that embrace asynchronous messaging and independent entities. These are the pillars for loose coupling, failures isolation, and simplicity of those systems.

On the other hand, people are starting to recognize that using OO languages often leads to unmaintainable, overly complex and error-prone code. Developers often forget, or don’t see that the core idea behind OO is messaging. Instead, they focus on classes, inheritance, and overcomplicated abstractions.

This also means that if you learn a technology that makes this idea a first-class citizen, you are more likely to succeed in other technologies. Learning Erlang will make you a better OO programmer by embracing the concepts of isolation and messaging. It will make you design better microservice architectures. It will allow you to prevent your Serverless application from becoming a huge, entangled mess.

Learning about those core concepts will make you realize that Serverless computing will not change the way we write software. You will see that it is just a cost-optimization technique. In some cases this optimization will work, but sometimes — not really.

Conclusion

If you want to be a better programmer, don’t focus so much on specific technologies, but learn the underlying concepts instead. Learn about isolation, asynchronous messaging, separation of concerns, composition, the power of good and simple abstractions.

Learn about the history of programming, about the trends emerging over the last few decades. When you analyze the ones that succeeded and the ones that failed, you will see a lot of similarities. You will see the same few ideas in the successful ones. You will be able to apply the same ideas in any new technology. It will make you a better programmer.


Originally published at appunite.com.

AppUnite collection

We teach how to write apps

Maciej Kaszubowski

Written by

Elixir developer at AppUnite | https://twitter.com/mkaszubowski94 | http://mkaszubowski.pl/

AppUnite collection

We teach how to write apps