What the heck is a JS framework anyway?!

You're going to discover pretty quickly, they're a ton of JavaScript Frameworks to choose from. Hopefully at the very least this post will give you some background information, so you can know what all the hubub is about.

Let me share the perspective of a person who is still fairly new to JavaScript (and programming in general).

Once I had a handle on some basics, I started to seek various resources to keep informed on the goings on (The Treehouse Show, JavaScript.isSexy Blog DailyJS) in the community. Suddenly, I was inundated with various catchy nouns with ".js" appended to them and they all made me feel like I had to know about all of them all at once!

Before we go any further, It might be helpful if we define what a framework is? I really loved this explanation from (Stack Overflow member Neha Choudhary):

If I told you to cut a piece of paper with dimensions 5m by 5m then surely you would do that. But then I ask you to cut 1000 pieces of paper of the same dimensions. Then you won't do the measuring 1000 times, obviously you would make a frame of 5m by 5m and then with the help of it you would be able to cut 1000 papers in less time. So, what you did is made a framework which would do that type of task. So, instead of performing the same type of task again and again for the same type of applications, what you do is create a framework having all those facilities together in one nice packet, hence providing the abstraction for your application and more importantly many applications.

Again, to a beginner we might be under the impression we should get into all of them. I suppose it would be like anything you "get into". For example, let's say you wanted an outlet to give your artistic side some expression. You can probably picture yourself being excited, finding a place where they offered various arenas where you could focus this energy. In the end you pick Illustrative painting.

So let's picture we are in that class one early Saturday morning—let's say it's the fourth class. Anyway, after a morning of painting the instructor decides to have a critique of a few samples of what each has done thus far. We soon notice when comparing our work to our classmates our work lacks something. Despite our paints being mixed properly, and our gesso applied in the most meticulous fashion to our canvas, our paintings seems to lack an underpinning. When the class convenes the instructor realizes our frustration and makes some inquires as what kind of work we have made before taking the class...As you can probably guess the answer is not much. It is at that point the venerable instructor recommends a fantastic book which will help with what is so obviously missing—stucture.

I like this analogy because I think it hammers home two of the important facets with JavaScript frameworks. First—in the application or the using of a medium—in this case—paint, felt like the way certain JavaScript frameworks would premptively make a lot of decisions for you. How? Well, imagine your next project was to convey a beautiful autumn afternoon in a small town in Vermont. Oil paints might be a great way to get the most of that sensibility and mood. However—water colors could easily fill the bill too. Basically we'd have to realize each medium would start with contraints and a way of working which would be vastly different from each other. Secondly this conveys the idea without the background of drafting and experience with composition, we might end up with Illustations which lack interest and dynamism.

You might be saying—"Antonio, bring it home with a example with JavaScript!" Ok, here goes!! You're working in Node to build a web app, so one could say Node is comparable to the starting point of wanting to do an Illustrative type of painting, and a framework, let's say Express.js would be the "way" you would go about accomplishing the work. Essentially these are agreed upon conventions made by a group or person which you must adhere to for the undertaking, i.e. you can't use mud in place of water for water color painting.

If you'd like a more real world explanation of all this, I highly recommend a podcast which goes a step further into this very subject Software engineering daily, JavaScript Concurrency with Kyle Simpson. It also goes into the rational why one should throughly learn the language a framework is based on. Happy Frameworking!

Antonio Pavicevac-Ortiz

My journey began as an aspiring Illustrator but soon was reforged into a career as a Graphic Designer with the web playing a supporting role. However during the for the past 6+ years, I have moved into the web development industry full-time! My area of concentration is JavaScript—specifically using ReactJS/NextJS; And Redux, and MongoDB to create websites and apps to create something dynamic and fun!