5 ms·
Plain javascript is nice, but if you're talking about getting a single bit of code to work in N many browsers, the "frameworks" start becoming less optional.
by TheZenPsycho 13y ago
Plain javascript is nice, but if you're talking about getting a single bit of code to work in N many browsers, the "frameworks" start becoming less optional.
- coldtea 13y agoActually the frameworks don't help in that regard. They are meant for organizing your code, they don't offer any special compatibility. jQuery does that.
- TheZenPsycho 13y agoWell let's define some terms here then. In the sense that I was speaking about, I was using "framework" as a synonym for "library". Not an entirely unprecedented usage. Underscore gives you array extras in every browser, even ones that don't have array extras. Mustache because let's face it, javascript doesn't have any nice way of doing templating or string formatting or anything. not without resorting to doing things that might not work in every browser. and backbone because, while some of the newer browsers and newer versions of ecmascript provide facilities for monitoring and reacting to changes, and doing data binding like things natively, not all browsers do. now I'll admit that backbone is not as new and shiny as say, that om/react/clojure stack making the rounds on hacker news, it's been around for a few years and it's still here. So that's something.
- coldtea 13y ago>Not an entirely unprecedented usage. Well, not a valid usage either given the context. From the examples you give, the only fitting one is Backbone, and even that it's stretching it a little (nobody uses the ES6 monitoring/reacting facilities directly atm, so it's not like Backbone gives them compatibility for them, it's like it provides them in the first place).
- TheZenPsycho 13y agoWhat does XCODE call a "library"? … a framework.
- jrub 13y agoand underscore. not for DOM, but for some functional compatibility (map, forEach, etc). Plus, it's convenience methods quickly become indispensable. _(fn).bind(this), anyone?
- rgbrgb 13y agoUh oh, I've been using fn.bind(this) everywhere. Is there a linter that will warn me when I'm not using cross-browser supported js?
- TheZenPsycho 13y agoit's called IE7. Any feature that's not cross browser supported is guaranteed to not be supported in IE7. A.K.A. lowest common denominator. Very soon to be IE8.