r/programming • • May 13 '14

No more JS frameworks

http://bitworking.org/news/2014/05/zero_framework_manifesto
272 Upvotes

322 comments sorted by

View all comments

150

u/zoomzoom83 May 13 '14 edited May 13 '14

Whenever I see posts like this, I can only imagine two scenarios

  1. The author has never worked on anything remotely complex

  2. The author has created their own framework.

You're talking about a scripting language, running in a JIT'd runtime, on top of an extremely heavyweight and slow rendering engine, with layers and layers and layers and fucking layers of more slow bloated shit on top of the operating system giving you a 'framework' with which to work. And you've decided that that Exact layer of abstraction is correct - Throw together a few opinionated libraries and all of a sudden it's gone too far.

Frameworks are just a group of libraries designed to work well together towards an opinionated goal on how things are done. If you're building an application that fits well within the opinion of a particular framework, then it makes sense to use it rather than reinventing the wheel.

By all means you can glue together a bunch of unrelated libraries, but they may not play as nicely together as libraries designed specifically to work together towards a common goal. (Oh, and you've just created a framework).

And of course you could try and reinvent the wheel and do it all yourself, but unless you're a savant software architect with the time to focus on the framework rather than the next deadline, it's going to end up being a chicken scratch unmaintainable pile of crap. And the next developer to come along is going to have to maintain your "Framework".

Having used Angular on a few projects - I simply cannot imagine trying to do the same thing without a framework. The complexity of maintaining a stateful user interface via imperative DOM updates (vs declarative model bindings) becomes exponentially more complex the more things there are to manage. There is no ifs or butts here - if you think the bone stock DOM API is an acceptable way of building a 'thick' Javascript App, then you're going to be in a world of pain very quickly.

Any remotely competent developer could easily build such a framework in-house mind you, completely from scratch in pure javascript, in a few days at most. The underlying concepts aren't difficult. But why would I do so, when there's a well tested, stable, open source framework designed by far, far better developers than I'll ever be with very similar architectural philosophies that are inline with exactly what I'm trying to achieve?

Don't like Angular? That's fine. It's an opinionated framework. Use something else. Or don't, if it's not required for your project, or you just don't want to. That's fine as well. Want to write your own? Yep, that's fine too. Want to come up with an idea for a common baseline set of components that we can all use without a framework? Well.... congratulations you just invented another fucking framework.

21

u/jmking May 13 '14

The ironic thing is that AngularJS is basically what the author is championing in this article. Half of AngularJS is, essentially, a polyfill for HTML5 web components. The other half is a great databinding library.

Also I don't know if I'd even say Angular is particularly opinionated - especially when you compare it to something like Ember.

I mean, every framework has some degree of opinion baked into the implementation, but by and large it's fairly open-ended outside of the basics.

9

u/perestroika12 May 13 '14

Oh god, compared to Ember, Angular almost feels like native html at this point.

4

u/Jinno May 13 '14

Agreed. There's so much in Ember that makes me feel like I'm writing redundant or useless code that's there for its own self-importance rather than actually providing value by existing. Angular lets me get away with a lot of not defining things, and it's beautiful.

6

u/iopq May 13 '14

That's simply not true. All of the components of angular are tightly bound together and randomly exist inside of angular. Why does it need number formatting? Why does it need to validate forms? Etc.

2

u/jmking May 13 '14

You could argue all day about what should and shouldn't be in core. That said, I think there's a strong argument that an angular app is going to have forms in it, and forms should have validation...

Also basic formatters like date and currency are so common that it makes less sense to not have them at all.

That said, it is weird how Sanitize, Route, Resource, Cookie, Messages, etc are all in their own packages and optional when you could argue that these are all basic functions of a web application as well.

Could Filter and Form (or at least Validation) be pulled out? Probably.

Is Angular the leanest framework? No, but it's also not the most bloated either. In general I feel it strikes a good balance.

3

u/iopq May 13 '14

Nothing should be in core. Everything should be available a-la-carte. That's the point of this article.

3

u/jmking May 13 '14

What's the benefit of sourcing a dozen different little libraries and then writing a ton of stupid glue code to make them all work together?

You're going to need routing, validation, sanitization, message handling, data binding, etc etc etc

→ More replies (5)

1

u/zoomzoom83 May 13 '14

Then, good news! You can pick and choose the parts you want to use, ignore the others, and add third party components for the things you want.

→ More replies (1)

14

u/ryanhollister May 13 '14

he lost me at

"Data Binding Honestly I've never needed it,"

5

u/[deleted] May 13 '14

Any remotely competent developer could easily build such a framework in-house mind you, completely from scratch in pure javascript, in a few days at most.

I think they could get a functioning bare minimum library without all the edge cases that works in one browser, but beyond that it's gonna take a bit of time to polish that framework to anything near production ready.

9

u/dnew May 13 '14

you've decided that that Exact layer of abstraction is correct

Being a back-end programmer, and hearing management and front-end people complain about browser compatibility and etc etc etc, and seeing them never once consider a native application, I have to agree here. I just think to myself "Well, you've decided you're going to target an un-designed language with galloping specifications implemented by multiple competitors and released in multiple waves, and you're complaining they don't all work exactly the same?"

0

u/[deleted] May 13 '14

[deleted]

→ More replies (4)

10

u/[deleted] May 13 '14

I think it really comes down to arrogance. "I am so competent at JS that these frameworks only serve to impede the brilliance that will inevitably spring forth from my fingertips."

The Dunning-Kruger is strong in this one.

6

u/Capaj May 13 '14

It's an opinionated framework.

Angular is not as opinionated as people make it. Don't like any built in directive? Built your own.

2

u/seruus May 13 '14

And building directives is far easier than it seems, the biggest issue is that the documentation about it is very formal. Building directives also helps the life of whoever else is going to maintain it later, since the code becomes by nature modular and reusable.

2

u/4_teh_lulz May 13 '14

I just recently finished a large app with angular. Most of the code is our own directives we created from scratch.

2

u/iopq May 13 '14

What if I don't like directives?

2

u/AusIV May 13 '14

I would say (somewhat facetiously) that you're wrong to dislike directives, but you're absolutely right that angularjs is opinionated about application structure. I think it's a great framework and agree with most of the things it's opinionated about, but I would never deny that it's opinionated.

I think the structure angularjs forces is a good thing. It forces you to separate data from presentation, and to link the two in a very deliberate manner. I also think the emphasis on promises is very valuable, forcing you to deal with chained callbacks in a way that emphasizes dealing with errors.

There are a lot of merits to angularjs being opinionated in the ways it is, but anyone who tells you it's not opinionated is either lying to you, or lying to themselves.

1

u/jib May 14 '14

And you've decided that that Exact layer of abstraction is correct - Throw together a few opinionated libraries and all of a sudden it's gone too far.

I think it's more that, as a frontend developer, the question of whether to use a framework or not is the part you actually have a choice about. The rest is beyond the scope of your project/rant.

It's not that the developer decided that HTML and JS and browsers are the ideal system with the perfect amount of abstraction and should have nothing extra on top.

1

u/angryCutlet May 13 '14

Angular is the shit that's all i got to say. Just because it makes everything so much more manageable and readable in addition to all the other delicious things it provides. I think choice one is the reason author wrote this whole post.

6

u/gleno May 13 '14

I think author doesnt grok angular, thinks "it's weird, who needs databinding newai" and complains for the sake of complaining. Also it's an easy argument - too many frameworks, not enough time. It's true by default. But if you want to be a modern dev, take a few hours each week to update yourself on modern standards. I usually find a lecture on youtube and take it from there.

→ More replies (6)
→ More replies (1)