r/javascript • • Sep 23 '19

You might not need a framework

https://medium.com/@pljeskavicica/you-might-not-need-a-framework-79444bda50d2
70 Upvotes

129 comments sorted by

View all comments

-4

u/Ivu47duUjr3Ihs9d Sep 23 '19

This is really good. You could probably do a series on this, just demoing mini patterns and code examples you can use to add functionality to your app with plain vanilla JS. Also how to structure the app for cleanliness etc.

A big advantage of doing a custom JS framework yourself is being able to maintain it in the long run and alter anything in it, nothing is off limits. The custom framework grows with the app. Now, how many programmers abandoned ship and changed jobs when they were told by their CTO to upgrade their massive SPA from AngularJS 1 to React with Redux, then 2 years later when they were half way through to rewrite again to use React with Hooks or whatever the flavour of the month is. When using someone else's framework you're not in control anymore. They are. They can decide to stop developing it anymore. Make you rewrite everything due to an architecture change. Deprecate that method you really depended on just because they feel like it.

React works for Facebook and their architecture. That's cool. That's an example of a pattern you can maybe use to build your own app. We sure as hell don't need to rewrite every website on the internet now to use React just because facebook are using it. Don't fuck your company by wasting all their money upgrading from React 0.1, to 5, 6, 7, Redux, Hooks etc. Companies have business objectives to achieve. Not endless churn upgrading their frontend framework due to the whims and fancies of some nerds at Facebook.

That said, don't have junior/intermediate devs constructing the initial skeleton/framework of the app. Code review what they do. Try and follow best practices. Borrow ideas if they're good [and] make sense for your app. Don't just follow the fad trend for the month. Be prepared to refactor things as the app grows. Have unit tests in place so that you can.

18

u/[deleted] Sep 23 '19

[removed] — view removed comment

1

u/ChemicalRascal Sep 23 '19

I'm not sure it's worth using Facebook's code just because it's Facebook's. They do have a point, churn for the point of churn is bad...

But no CTO is going to sink their company by blindly chasing the flavour of the month latest thing. Or, well, no competent CTO. If your CTO is that incompetent, you have bigger issues (in the form of that you'll have no working product and then your pay cheques will start bouncing).