Thursday, May 14, 2015

against angular.js

Some very negative arguments against using Angular.js and some of this matches impressions I have - Hacker News' link to it had some counterpoints however.

It's interesting talking about this with people at work. Many smart people agree with me, and many smart people don't. There are very different mindsets out there about the way things should be. Some people prefer terse, concise, declarative code; others prefer conceptually simple, easy-to-trace, procedural approaches. People's personal development histories seems to weigh in heavily.


I used to make web-based tools to help make the graphics for Atari 2600 games - PlayerPal2 being the most impressive, not terrible for 10 years old code, and before I knew jQuery and the like.

On Atari Age a developer gauauu announced a Playfield graphic editor, and I was interested to see he used angular.js.

When I mentioned that it that (in a neutral/positive way) he said
Yeah, I'm no expert with angular but I find its declarative style to be a whole lot easier to deal with than raw JavaScript or jquery for DOM manipulation.
My response was
It's funny, I find declarative style to be so annoying. It's very top down, and (IMO) hard to debug when things go wrong because of the distance between the code you wrote and the code that's actually running in the browser. But, it's a pretty popular style. I've been trying to figure out why I don't find it more intuitive. (One thing is, I kind of prefer thinking of the DOM as a decoupled, stable place to manipulate and read from, vs tightly coupled to shared memory. Writing code inside of tags feels very JSP like to me) ANYWAY
I was surprised by his response:
Yeah, debugging it is a nightmare. I find that for small projects it's worth the tradeoff. For bigger projects, the inability to debug reasonably or clearly see what's going on is killer. We experimented with Angular for a larger scoped project and work and found that the tradeoffs weren't necessarily worth it, in terms of productivity.
Huh! That's the opposite of what I usually here, in terms of people saying "sure, use jQuery or whatever for some small project, but when things get serious, you really need a framework".

And yet, he finds it easier for certain small one-off things like his editor.

Sometimes I think my years of experience making things via the DOM and js work against me...

No comments:

Post a Comment