4 ms·
The growing body of Javascript code also means Javascript needs more than just those 16 objects. I don't know, I don't disagree with the sentiment that the sta
by n8agrin 17y ago
The growing body of Javascript code also means Javascript needs more than just those 16 objects.
I don't know, I don't disagree with the sentiment that the standard lib is pretty bare, but I also think that's the beauty of JS. Also, there are any number of other libs (as the author points out) that add much of the desired missing functionality.
To the author's point of having many libs (jquery, etc) and no chosen standard, I don't see that as a bad thing. To me that just shows that the language succeeds in allowing authors to use it according to their own style and liking.
- cgranade 17y agoTo my mind, part of the point was that there's no standard way of importing additional libraries. Many modern languages have some sort of symbolic import statement that instructs the interpreter or compiler to add additional libraries to the execution context, but there's no single way of doing that from within JavaScript. Of course, that somewhat makes sense, as you don't want every random site making cross-domain imports and bypassing same-domain policies. At the same time, as the author demonstrates, you can have an agreed-upon API that provides much of the same functionality using XHR, which would make working with multiple libraries from different vendors a lot nicer.
- tolmasky 17y agoCross-domain is not really an issue here, its quite silly that I can't in JavaScript require one file on my domain from another file in my domain. Instead, people have spent countless hours trying to figure out "the right way" to have interdependent code that doesn't block through a synchronous XHR. Sometimes this has resulted in requiring build tools which turn imports into script tags, etc (which is frustrating for a language that shouldn't require building). This is why Objective-J has @import: @import <Foundation/CPSet.j> @import <AppKit/CPView.j> alert(CPView); What's really upsetting is that we're getting the first update to JavaScript in like 10 years, and these fundamental concerns are still not being addressed. Instead of saying "what can give us the next generation of web apps", we've dropped the with keyword. Objective-J was really designed as "man, these features should have been in here ages ago". @import allows you to require code without a build step, without downloading or running twice, and still having it all take place asynchronously so that we don't block on some slow file.
- josh33 17y agoStandard library = socialism Many open libraries = capitalism Since capitalism elucidates turrets in some people, I'll add that what I'm driving at is competition breeds innovation and quality. If one library adds functionality another doesn't have, then it will add it, and in the process, improve on it. Awesome!
- spoondan 17y agoA standard library does not preclude third-party libraries. In fact, a good standard library can make it more likely for third-party libraries to meaningfully compete. Reducing the amount of incidental (utility) code that needs to be written can: 1. Allow established entrants to focus on more beneficial areas. 2. Lower the barrier to entry for new offerings. 3. Reduce the number of defects by shifting resources away from maintenance of incidental functionality.
- RyanMcGreal 17y agoThree cheers for the mixed economy!
- xtho 17y agoC++, Java, C#, even common lisp programmers are socialists then? And hey, JavaScript is a standard too. Does this mean JavaScript is the tool of socialists? I personally consider it actually funny how the notions of socialism and capitalism are used by some posters on this website as if we still had 1970 or something. How old are you?
- cousin_it 17y agoWhile josh33's point about politics was pretty inane, there is indeed danger in picking one framework as the "standard". Imagine if C++ adopted Qt as the standard, leaving WxWidgets, Ultimate++ and others in the lurch. I think this would be the proper analogy to the proposal of pulling jQuery into the JavaScript standard.