Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, have you ever tried to program in javascript? It's a fantastic language for prototyping. If you want to try an algorithm, you sit down, write an astonishly small quantity of code and it just works. That's just one of the reason why I use javascript.

Another is, that it's a fantastic language to use for hobby projects, because you don't need to think too much beforehand, thanks to the dynamically typed variables, methods and objects.

And last but not least, you don't have any GUI to manage. HTML does it for you, which simplifies matters a bit. You want to dynamically create HTML? No problem. You prefer to prepare the HTML beforehand? No problem at all.

So to answer your question, I use it because it's refreshingly easy to use, more so than richer languages who are sometimes simply too heavy.



That's basically the same reasoning that applies to any server-side scripting language: high level scripting languages are much more efficient to develop with than more structured lower-level languages, and the web-application model lets you use HTML as your GUI which is quick, easy, and flexible (though not as rich or stable as client-side GUIs can be.)

My personal preference for server-side development is Modern Perl, because it lets you develop anywhere along the "highly structured" to "rough scripting" line that you please. Other server-side languages are fine if they suit your development style, but I like to adjust my style to suit the project, and to use a language that can adapt to whatever style I need.

Client-side, Javascript is great especially with jQuery. I couldn't deal with javascript development without selectors; it's far too much effort. I'll have to give Javascript a try for server-side development, but I don't think I'd want to do a large project in Javascript. My current application at work has nearly 7K lines of client-side Javascript, and it's already getting unwieldy.


> Client-side...jQuery...nearly 7K lines

The reason I only use jQuery for ajax-sprinkles apps (take a static app and make it ajaxy!) is because it provides no tools for dealing with larger size programs. I used to use MochiKit for the Signals module, but I've switched over to yui3. It's roughly the same terseness of jQuery but with an excellent set of tools for organizing/decoupling your code.


Besides using JS on the server with Helma for some time, I even wrote a Lisp->JS compiler (CyberLisp) in JS. This project finally showed me that I don't want to use JS anymore.

I agree with your point about prototyping, but I don't see why one would use a language that's good for prototyping, but sucks in the greater scheme, for web apps.


It's a fantastic language for prototyping. If you want to try an algorithm, you sit down, write an astonishly small quantity of code and it just works.

That's true of Python and Ruby as well, both of which have basic features that Javascript lacks like modules and namespaces, and don't have its silly misfeatures like implied global scope. Javascript may very well end up "winning", but that will be because of its ubiquity in browsers and not on technical merit.




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

Search: