Hacker News new | past | comments | ask | show | jobs | submit login

Could you please go more in depth about "functional-style hooks ... before the framework madness"? I'd be interested in reading your thoughts as a newbie JS dev currently studying backbone/angular/jquery and other libraries.



I believe that what he meant (Correct me if I'm wrong), is that instead of creating a system of classes that tries to abstract everything out of the DOM, it's better act on the DOM itself, via jQuery, Zepto.js, etc.

In some ways, what I showed in the post is functional.

- Select a DOM i.e var $elem = $("#anElementId")

- Act on it i.e $elem.fadeOut()


And yet what about the "JQuery soup" problem that everyone complains about? Isn't that due to having DOM manipulation code strewn about willy-nilly?


Sometimes, it's good to encapsulate stuff into a class when you have a complex logic around a specific theme.

It's not one or the other. It's one AND the other.


There was a nice set of slides few days ago - http://www.slideshare.net/nzakas/enough-withthejavascriptalr... - exactly the same idea.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: