The software world has gone through some radical changes and developers from various colors and genders find their way into web technologies. The client side (now known as Frontend) is becoming rich (again!) with much logic and state.
I have already went through such technological revolution, it was back in the 90s when I stopped working on Main Frames that took the space of a track, and started coding in C on PC computers.
Later on came that time where C developers where out shined by C++ coders, it was a time with much ambitions, hormones, and Object oriented.
And then Java came, pure-blood object oriented, with the hit ‘write once run anywhere’ and trashed her oldest sister, calling her: C with Classes.
Just object-oriented that thing
It is truth that our eyes where shining with hope and excitement, we believed that if we will only succeed in describing the world with Classes and Inheritance, and objects will encapsulate state, then we will find the answer for the biggest mystery — how do you code a system that is maintainable, and that does not get rotten so [f] quickly.
Many developers are still trained by the rules of Object Oriented Programming (OOP), but it is also known that systems that are built with OOP have many challenges regarding concurrency (multi threading).
When shared mutable state is in order, you need to do crazy things like padding to optimize the thread isolation model (for instance take a look at the source code of Java’s very own concurrent data structures (line 278))
Don’t get me wrong, we owe a lot of modern ideas and design patterns to OOP, and there are places where classes do make sense (i.e. — games), but it was realized that Object Oriented and Concurrency are not best buddies.
You can also say that lord concurrency has smashed Object Oriented systems to pieces, and brought developers to their knees trying to fight synchronizing issues.
Shared mutable state concurrency is too damn hard:
incorrect synchronization, bottlenecks, deadlocks, starvation, inconsistent behavior, lost updates or dirty reads, are all there like accidents waiting to happen.
Today, it is becoming clearer that functional [reactive] programming has many advantages and platforms such as Angular, depend and expose RxJS Observables as the front gate for its API (i.e. value-changes, routing changes, HTTP calls)
Gazing at the future with hope
Modern Frontend systems such as Angular, React or VueJS bring to the table a set of great ideas from all times:
Place of respect to (limited) OOP
An invitation for functional programming at the right places
Tools to manage state in a predictable way (Redux, Mobx and the beautiful Vuex)
So take it easy with Object Oriented, and most importantly, remember that there is nothing as dangerous as a warlord with a map and an idea, and keep an open mind !