DEV Community

Discussion on: VanillaJS or Frameworks/Libraries (React)?

Collapse
 
peerreynders profile image
peerreynders • Edited

but React or other frameworks seem a bit off to me.. strange..

I've left some extensive comments regarding "React and the Web" with an earlier article which I'm not going to repeat here.

I think PHP creator Rasmus Lerdorf has a salient point (Frameworks - they all suck!):

  • Everyone needs a framework
  • What everyone doesn't need is a general-purpose framework
  • Nobody has a general problem, everybody has a specific problem they're trying to solve
  • While the general purpose framework can solve it, it usually solves it in a less than optimal way (i.e. choose your trade-offs wisely)

From that perspective:

  • Angular JS was developed for Google's internal "Green Tea" CRM application. It primarily targeted the desktop web over the corporate backbone. So the fact that is was relatively heavy-weight didn't matter and the prevailing enterprisy mindset ("it fetishizes complexity exactly the way that Java developers are used to") favoured "batteries included application frameworks".

  • React on the other hand constrained itself to be a "view framework" for public facing sites of the desktop web that had an API that could be learned in a weekend (though that didn't constrain the growth of the supporting ecosystem that developers would have to contend with). What people don't seem to account for is that Facebook has the resources to develop and maintain native clients for any device they wish to support on the planet. So their web solution just has to be just "good enough" to get people hooked to download the native app.

  • Evan You had worked with Angular JS and concluded that most applications would never benefit from the complexity that enterprisy applications are so fond of - so he created Vue. Vue had to take on Angular and React and isn't backed by the resources of a mega-corporation. Compared to Angular and React, Vue's much more of an open source community effort; so it is actually respectable what it managed to accomplish over the past 6 years.

  • Rich Harris is responsible for Svelte (Rethinking reactivity/The Return of 'Write Less, Do More'). From what I've seen I have to guess that he is used to working pretty close to the browser-metal because Svelte feels like an extension to what the browser is already capable of and tends to work with it rather than against it, smoothing over the rough edges quite nicely - while deliberately not setting out to create an entirely new paradigm.

Back in 2000 "The Pragmatic Programmer" recommended to "Learn at least one new language every year" as a means to escape one language. Similarly I don't believe that "one framework" is enough - unless you are a building the same type of application over and over again.

In my judgement Svelte should be the easiest to learn (though at this point likely the least commercially viable), Vue is workable but React has grown to such proportions that it is hard to escape (well, at least Preact is a partial escape) from - but I think it's a good idea to have other irons in the fire.

Tailwind counter opinions
Musings on Tailwind - part 1
Musings on Tailwind - part 2