News for hackers. Stuff that matters.
Re:Responsive JavaScript in Rails: load what you need when y... by dschiptsov on Wednesday July 17, 2013 @10:24AM (#6057777)
The much simpler idea is to stop using bloated, general purpose frameworks, and just use tiny, functional-style hooks when needed, the way people used JS in days before the framework madness.)
Re:Responsive JavaScript in Rails: load what you need when y... by pkorzeniewski on Wednesday July 17, 2013 @11:03AM (#6058042)
After using several frameworks in various projects, I must agree with that. The main problem with frameworks is that they work well until you try to do something they weren't designed for - and then you end up with a pile of hacky and messy code. With smaller libraries it's much easier to replace one for another or just write your own small piece of code that will do exactly what you want.
Re:Responsive JavaScript in Rails: load what you need when y... by rfnslyr on Wednesday July 17, 2013 @11:06AM (#6058062)
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.
Re:Responsive JavaScript in Rails: load what you need when y... by pothibo on Wednesday July 17, 2013 @11:11AM (#6058094)
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()

Re:Responsive JavaScript in Rails: load what you need when y... by platz on Wednesday July 17, 2013 @11:28AM (#6058213)
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?
Re:Responsive JavaScript in Rails: load what you need when y... by pothibo on Wednesday July 17, 2013 @11:35AM (#6058268)
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.

Re:Responsive JavaScript in Rails: load what you need when y... by dschiptsov on Wednesday July 17, 2013 @01:15PM (#6058850)
There was a nice set of slides few days ago - http://www.slideshare.net/nzakas/enough-withthejavascriptalr... - exactly the same idea.