DEV Community

Discussion on: You Probably Don't Need A Front End Framework

Collapse
 
darrenhoy profile image
DarrenHoy • Edited

This is a really interesting point, which I read as what the article was getting at - that frameworks always bring an overhead. Sometimes it's computing-related (memory, execution time) and others it's cognitive...having to understand the framework to do anything useful. The aim is that the gains from the framework exceed the overhead. In the case of ORMs (that is Object-Relational Mapping - translating SQL into objects) theres such an assumption (wrongly, often, and touted by OOP developers who don't understand SQL) that the gains are obvious and don't need to be explored. Writing stored procedures in a database and calling them directly is perfectly fine in lots of cases! Go for it, I say.

In the case of client-side frameworks though, abstracting the DOM is the reason to use one...any one. There really isn't any such thing as the DOM; there are multiple implementations that appear similar but vary according to the browser being used. In the case of web apps, the browser is a choice of the user, not the developer, and so the developer is encumbered with having to test functionality across all of the differing implementations. Client side frameworks do this for you. Knockout.js, for instance, has support for browsers going back to IE6 - try doing that with vanilla JS.

Server side rendering also has its challenges. Take a simple tick-box filter, for instance. The click in the checkbox doesnt trigger a post back, so you have to listen for it and force it through using JS (taking into account all of the differing browser subtleties), then figure out on the server what state your UI was in (HTTP being stateless, the server has no intrinsic "memory" of what this particular user saw beforehand so only has the data posted back from the client to go on).

In the case of client-side frameworks, therefore, the overhead is miniscule in comparison to the advantages, which perhaps explains why there are a) so many of them and b) why even in the smallest projects they are worthwhile.