Frameworks vs JavaScript

It's said among my peers that a todo-list is hard to do without a framework. So I decided to make one in vanilla (no framework, just normal) HTML, CSS and JavaScript.
You can see it in action below ... View the source code!! ... Then compare it to how it would look in React (a popular JavaScript framework), in the image below, print-screened from react homepage.

Todo-list example

Source code for a todo-list in React. Sorry for the image blob

Rant about Frameworks

I'm targeting React here, because it's very popular and considered "the best" framework among my peers. But my rant could be about any framework.

What is a programming language?

My definition of a programming language is something that requires compilation. And as React has a compilation step, I do not consider it as JavaScript, even though it compiles to JavaScript. It really is it's own language. And it's not only a different programming language, it's a sort of virtual machine that runs a virtual Document Object Model (DOM). So it adds two extra layers of abstraction/complexity, that slow down performance.

You want to control main

You want to write code that calls other's code, not code that are called by other's code, where it's difficult to know what will happen. Something might seem very simple, but it's actually very complicated.
If you control main, you control the program, otherwise the program controls you.

What if the company that made your framework stops supporting it, or make a new version, or drops support for your code ? It's then up to you to rewrite your code, or work around bugs and issues with your current version of the framework.

Forced paradigms

If you want to do something outside "the frame" of your framework, it will be like swimming upstream, or not even possible.
If your project will be long lived, best practises will change, and new API's will be developed, which might not be supported by the framework.

Hard to replace

It will be hard to replace the framework without rewriting your whole application.
If you do not use a framework, you can continuously adapt, and rewrite in small steps.

And the framework might lock you into a proprietary ecosystem. While the framework is free to use, you might have to pay licenses for the platform and special tools needed.

Learning curve

It might be hard to find programmers that have experience in the framework. While just about every web developer knows vanilla HTML, CSS and JavaScript.
And while HTML, CSS and JavaScript is here to stay, there's a high chance your expertise in the framework will become obsolete.

Written by Johan Zetterberg October 11, 2016.

Follow me via RSS:   RSS https://z├Ą (copy to feed-reader)
or Github:   Github