Hacker News new | ask | show | jobs
by hrish2006 4212 days ago
I wonder if we need any JavaScript framework at all, given how far JS has come in recent years, yes, I use an MVC framework currently for the apps I'm building but I'm writing more and more of my apps these days using nothing but vanilla JavaScript(ES-6 to be exact) and the dom apis, and I'm not depending upon any framework. (well, I use traceur but only because ES-6 support is not fully baked in to all browsers). IMO the frameworks that are all out there today are simply too big and try to do too much for you. The only libraries I use from time to time are underscore, d3 and moment.js.
3 comments

I'm finding that in many cases the old adage holds true: "You're always using a framework. Either you're using an existing framework, or you're building your own." (paraphrased)

Sure, if legacy browser support is not a concern and you don't need to support bleeding-edge features (i.e. unstable APIs), you can go a long way with vanilla JS. But at some point any large system needs abstractions in order to stay maintainable. And if you don't use existing abstractions, you'll have to come up with your own abstractions.

Of course the other option is to simply not build large enough systems to require abstractions.

That said, I do prefer smaller libraries, too. This is why I see React not being a full replacement for all of Angular as a feature rather than a limitation.

I only ever began considering Express as a framework when it dropped the vast majority of its features (mostly middleware) in 4.x, too.

Well, a custom framework might evolve when you write everything using just JavaScript, but I've found that when such a thing does happen, it suits your needs perfectly. Even if I screw up, I'll at least know where to look when I'm debugging :)
Time to wheel out another paraphrase of Greenspun's Tenth Rule (http://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule)

How about:

"Any sufficiently complicated collection of libraries contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of a full framework"?

;-)

That sounds about right :) . However, you need a great degree of discipline (greater compared to other languages IMO), to write good JS. JS enforces almost nothing, so it's up to the programmer to design an application architecture that suits her, so it might not be as ad-hoc in real life applications after all.
This works ok if you're a single developer working alone on a project. This becomes very difficult in a larger group where you have some turnover and everyone has different backgrounds. Having a framework that makes a lot of the decisions for you greases the wheels to productivity. Give engineers an inch to bike-shed, they'll take a mile when choosing the paint color.
This. A lot of the frameworks are doing things that can sort of be done with vanilla JS now — personally I’m waiting on Object.observe to become more widespread.
Yes. Object.observe, arrow functions, comprehensions, yield and yield* + promises, what more do you need? :)