A transitional experience from jQuery to Knockout to AngularJS to React to Angular
It has been 12 years since I became a devoted student of JavaScript in the professional arena. Over this period, my learning path kept changing as the philosophy of JavaScript-based web development evolved at a rapid pace. I started my career in jQuery, later I was introduced to KnockoutJS. Then I moved to AngularJS (1.x), followed by React. Now, my upcoming venture expects profound knowledge in Angular(9), which I started learning a couple of months ago. That's why it's essential to keep molding yourself with time to stay relevant. In this article, I'll be trying to articulate my learning experience and to comprehend how the philosophical changes took place in the JavaScript realm.
jQuery Saga
Considering the pre-jQuery era, where the developer had to write a lot of code just to create a DOM node and manipulate the same. jQuery actually brought autumn at that time to those developers. When my career took off, jQuery was shining in the middle of the sky. $(document).ready() was the ultimate bootstrapping function where the modular pattern and factory pattern were the standard way to modularize the code. We had to bind the event(s) for every DOM element with the callback function. We had to make DOM manipulation once we used to get the updated data from the asynchronous Ajax response. Under this circumstance, it was indeed challenging to gain performance unless you started leveraging the JavaScript object orientation to organize your code. It made me keen on this, and eventually enriched my knowledge. I would like to pick three points that actually helped developers at that time to fast-track web development.
The primary reason for the jQuery saga was an easy learning curve. When I turned back to that time, it was indeed a cumbersome way (considering the way of writing code in the present era!) to write code but loaded with a lot of fun and curiosity.
Knockout punch
Consider this, you have a dropdown box with multiple options. On clicking a button, you are fetching a new set of options from the rest API so that the list of options in the dropdown box should get changed accordingly. In jQuery, we had to write code (or call the modular function) to update this dropdown DOM to fulfill the requirement. The legend developers became greedy. They started eyeing introducing a templating engine that could use javascript variables to update the DOM in both ways if either of them gets the updated value. That time many such libraries came e.g. Mustache, KnockoutJS, Handlebars, etc. Knockout was a standout performer among others. I was fortunate to get the opportunity to work on the same for a couple of months. According to me, these are the following reasons that allowed KnockoutJS to overpower jQuery.
It was the beginning of the end of the jQuery saga. As the templating concept was entirely new to the other developers, the learning curve was a bit steeper than jQuery. To me, it was the drastic change of philosophy to segregate the template from the logic. The DOM manipulation became obsolete. Eventually, the UX started getting more complicated than before as we had to concentrate on writing efficient UI logic only. Indeed, it saved the day of every developer.
Invincible AngularJS
KnockoutJS actually prepared the path for the inevitable arrival of AngularJS. It put the last nail in jQuery's coffin. At that time, getting the opportunity in AngularJS was an awe-struck experience as it was not just a library like others but rather, a full-blown framework with a lot of path-breaking concepts. As I did work in Java, adopting the same framework philosophy in the JavaScript realm, was quite remarkable for me.
My first analytical observation was, AngularJS did force developers to write code abiding by specific patterns. There was limited flexibility to experiment on the implemented design pattern. However, there is a debate on whether such enforcement is good or bad. Anyway, it actually helped developers to write less bootstrapping code and focus more on behavioral UI logic development. However, according to my experience, it earned my respect due to the following reasons.
领英推荐
Overall the AngularJS was invincible at that time for developing complex SPA.
React'ive Adventure
The two-way binding was the fundamental feature of AngularJS, later the same appeared as a double-edged sword in regards to the application performance. Meanwhile, shadow DOM came into the play to produce a better performance boost. However, it was indeed difficult for AngularJS to fall back to Shadow-DOM as they already accepted Real-DOM as the bone of their rib. So the AngularJS community decided to move on by rewriting the core logic, and they named it Angular. At the same time, another library emerged named React. I was fortunate to get the opportunity to endure a philosophical change again to start thinking in the react-way.
React-way is totally different from AngularJS. It doesn't comprise two-way binding, directive concepts, etc. like AngularJS. As React is a library, it allows experimenting with various patterns like Flux/Redux, adopting the functional programming paradigm, etc. Unlike AngularJS, React encourages the developer to use atomic-level components that could be nested up to N levels. The following are the reasons I enjoyed working in React a lot.
React is indeed a brilliant library to use if you need to develop something very quickly. For the time being, the long four-plus years of an affair with React is going to an end as my new venture requires Angular to be associated with.
Herculean Angular
This transition was a bit easygoing for me as I worked in AngularJS earlier. The concept and fundamental philosophies are more or less identical. The primary differences are, adopting TypeScript which I already knew, and changing syntactic sugars. As I'm still in the learning phase, I've figured out a few key points that I loved the most so far.
So far, learning is going well. It is indeed a satisfying experience to be part of such rapid transitions in the JavaScript realm. I wish for some more brilliant frameworks/libraries to come in the future to ease the developer's work. Thanks for reading this article, and feel free to share your experiences too. Happy learning!