4 ms·
Cool project. I'll never understand why anyone wants to program in JS though.
by agentultra 16y ago
Cool project. I'll never understand why anyone wants to program in JS though.
- past 16y agoBesides being an incredibly powerful combination of a functional and an object-oriented language, I just adore the fast redeployment cycle during development. With appenginejs, I test every change in the backend code by simply refreshing my browser. Not jaw-droppping per se, but certainly a breath of fresh air for a long-time "enterprise" Java developer, like me.
- sreque 16y agoJavascript's functional powers are equivalent to or worse than every other popular dynamic language in existence. Speaking of functions, I prefer not to do argument arity checking on every single function I write(I'm looking at you too, perl!), or accidentally assigning global variables through a simple misspelling. I also really hate it if I accidentally invoke a function on a primitive and it silenty fails by returning null. Use 'use strict', you say? How's the implementation of that feature coming these days? I know firefox still doesn't have it. Does v8 yet? From what I've read, other Prototype-based languages treat Javascript as their ugly step cousin, and I would overall consider it a much inferior OO system to that found in Python, Ruby, CLOS, Perl's Moose, and PLT-Scheme, to name a few. You can easily get rapid redeployment in any dynamic language. You can even get it on the JVM with Java, as the Play framework is showing us. See http://www.playframework.org/ http://www.playframework.org/. If Javascript is your first dynamic language after developing in Java for X years you might think it is neat, but it is really far behind just about every other language out there it directly competes with on the server-side level. It was never designed to be a scalable general purpose programming language and the latest incarnation is still far from reaching that lofty goal.
- artlogic 16y agoI used to feel this way. The two people that changed my mind were John Resig and Douglas Crockford. Resig's jQuery project has been, for me, a guide to how JS should be written. Crockford's JS the Good Parts and JSLint have helped as well by providing some solid reference on what to do and, more importantly, what not to do. Lots of folks only see the DOM and the bad parts when working with JS - these two projects have shown me there's so much more.
- orangecat 16y agoLots of folks only see the DOM and the bad parts when working with JS Agreed that you can't blame Javascript for the DOM, but there are lots of bad parts aside from that. Default global scope and semioptional semicolons are gigantic WTFs, the with statement should be nuked from orbit, and there are generally lots of ways to write code that appears to be correct but is just waiting to fail in bizarre ways. It's just annoying that we're stuck with Javascript because it's so entrenched, while Python and Ruby offer all of its strengths in much saner packages.
- artlogic 16y agoI believe I did say "and the bad parts". I agree - there are lots of bad parts to JS - I often wish it could be remade without the bad parts. However, a lot of these bad parts can be mitigated with sane conventions - that's what Crockford's "Good Parts" is all about. If you haven't read it, I highly suggest it. I can't speak for Ruby, but in many ways JS is more powerful than Python, especially on the functional side of the house.
- polgardy 16y agojQuery is a great project, but it's definitely NOT how JS should be written. Its goal is to be fast, unobtrusive, and work in most browsers at the expense of comprehensibility.
- artlogic 16y agoI'd argue that jQuery embraces a lot of ideas that new JS programmers often overlook - functions as objects for example. jQuery also gives you primitives to perform functional/set based operations. For me, approaching JS as a functional language has been the key to writing good clean JS. jQuery helped me with this by allowing me to ignore all the psuedo OO stuff in JS and concentrate on the functional features.
- agentultra 16y agoLet me clarify: don't think JS is bad or anything. I just personally don't like it as a language. With so many projects coming out using JS as the primary scripting language, I am probably going to have to suck it up and learn to love it methinks. Just not yet. ;)
- gmosx 16y ago1. JS is a great language. 2. You can reuse code on the server and client side, no mental context-switch. 3. Javascript VM's are generally faster than Python VMS. 4. Rhino provides access to the vast collection of Java libraries 5. App Engine is the easiest way to go from a toy application to a industrial strength, production application
- sreque 16y ago1. No it's not. It's mediocre at best. See my previous post. 2. No you can't, not anymore than you can reuse Java code between client and server with GWT. The difference between a browser and a client environment is just so great. NaCl will hopefully provide a way to bridge that gap, but that will work for every language, not just Javascript. 3. PyPy is starting to catch up to v8. This point is irrelevant for the AppEngine, by the way. I doubt Rhino is any faster than Jython. 4. Ever heard of Jython? 5. Ever heard of Jython? Certain languages get way over-hyped on HN, and Javascript is one of them.
- gmosx 16y ago> 1. No it's not. It's mediocre at best. See my previous post. of course it is > No you can't, not anymore than you can reuse Java code between client and server with GWT. The difference between a browser and a client environment is just so great. pure bs, obviously you don't know what you are talking about. I am reusing extensively between server and client, not only for simple stuff like validations, but also to render graphics (have a server side canvas implementation that renders to svg), to perform web crawling (I use a simple version of envjs and jQuery/sizzle on the server side for crawling), i use the same template engine on server side and client side, etc, etc... > 4. Ever heard of Jython? Why would I be interested in Jython??!
- sreque 16y ago1. You either didn't see my previous post or have no useful response. 2. Sorry, let me rephrase my point here. You can reuse code, but not all code. Any code you could reuse could also be re-used in another languages using tools like GWT, py2js, j2js, etc, mitigating server-side javascript's advantage here. As for points 4 and 5, I couldn't care less whether you're interested or not. My point is that javascript has no unique advantage here over most other popular scripting languages, and you made an earlier comparison to Python, hence the Python example.
- exit 16y agoif you only dislike js syntax, check out coffee-script: http://jashkenas.github.com/coffee-script/ http://jashkenas.github.com/coffee-script/