A typical Angular app is a veritable sea of Singletons ie. Stateful Services.

A typical Angular app is a veritable sea of Singletons ie. Stateful Services.

Sometimes it feels as if the Angular team decided to collect together all the world’s worst programming patterns and a put them into one convenient framework.

Originally shared by mathew murphy

Many people have expressed the opinion that singletons are a code smell. Now someone has looked at codebases to quantify to what extent that’s true.

3 thoughts on “A typical Angular app is a veritable sea of Singletons ie. Stateful Services.

  1. John Hardy Turnbull delenda est Erlang is purely functional and dynamically typed. Every module runs in it’s own process. Communication between processes is done entirely using asyncrhonous message passing. Receiving messages is synchronous. WIthout global variables, you must manage state as objects passed to initializing function of each processs, and this state is updated by way of recursive function calls evaluated as the module code executes in it’s own process.

    The Erlang OTP (standard library) provides mechanisms for live-updating processes when you recompile the source code in the module that owns it, and also mechanisms for re-launching processes that crash. Erlang programmers are taught to “crash early, crash often.” This tends to lead to rapid development cycles and very, very stable code that runs without ever crashing because bugs tend to be worked out right away.

    CloudHaskell is a project with the goal of providing similar functionality to the Haskell language.

    Like

Leave a reply to Ramin Honary Cancel reply