I heard Javascript is a full language just like c++. Is this true? What else is it good for programming besides web stuff?
|
I think it's worth learning because it's quite different to your run-of-the-mill OO language and at the very least you'll learn a different programming paradigm. Can it be useful anywhere other than in-browser? Sure: check out node.js, which uses javascript's asyncronicity to create a purely non-blocking dev platform, and couchapps, which lets you build an entire web app with it. If you believe some people, javascript will be the major future dev language, purely because of its wide usage. It's by far the most popular language on github, and almost every dev has some exposure to it. With projects like node.js, javascript has an interesting future. |
|||
|
|
|
Javascript is a great foundation language It is :
I personally believe it is worth learning even if you won't use it daily. It will broaden your mind such that you consider different solutions when using other languages like C++ or C# - e.g. Iteration versus Algorithmic solution, dynamic typing and type inference. I have seen people use it to crunch numbers/data dumps faster than professional tools, by pasting their data into an HTML text area of a page they'd constructed with some JS code behind to work through the data.
Embedding inside something else: All of the companies I've worked for in the last 12 years have built both commercial products and internal development tools that used JavaScript (or close relative - ECMAScript, ActionScript, etc) as the foundation as it was easy to learn, had easily-integrated (free) implementations ready to go (SpiderMonkey and Microsoft Active Scripting SDK) and performance was 'good enough' to begin with and has just kept on getting better. Before jQuery/Prototype and the whole AJAX movement came along, the choice of JS seemed non-obvious - why not use VBA (shudder), something lex+yacc-able or roll your own language? The power of JS as a language combined with rich widgets/frameworks meant not a whole lot of code needed to be written, so an off-the-shelf solution was attractive as more effort could be spent on the rest of the product. As the language has increased in capability and speed, the bet on JS has paid off. With more developers able to grok JS, hiring is easier too. |
||||
|
|
|
As far as I know, besides web programming, JavaScript is also used for some new desktop environment too. For example, GNOME 3 (a desktop environment for Linux) using JavaScript+CSS to let users and developers customize their desktop environment. |
||||
|
|
Creating Metro style app using JavaScript would be using JavaScript for Windows 8 that may be interesting to see where this goes. Just another idea to add to the other answers here. |
|||
|
|
|
I was going to add this as a comment to the accepted answer but then realized it might be better served as a separate answer. That said, it is meant more as a complement to the accepted answer rather than a competing answer. Scripting extensionThere are many Javascript engine available for most of the big languages that you can embed in a system. This makes it a good choice for extending your platform with scripting capabilities and beats hands down inventing your own language. You instantly gain all the learning material so getting resources to configure and script your system will be a lot easier. |
|||
|
|
|
Javascript is also used for Greasemonkey scripts that you can use to customize or add functionality to sites you visit. (That link points to the Firefox extension, but it's also available for other browsers) Technically of course this is still "web stuff", but it's different in that the web developers aren't the (only) ones using it. |
||||
|
|
|
There are other technologies based on Javascript that you could learn instead if you want. Learning them would at least let you understand the syntax of javascript when you run across it reading source code for web pages. And lets admit it, we all say we're not going to ever do X, but in the end at some point we always do. At least a little bit. A good javascript-like language to check out is Qt's new QML language, which is javascirpt like syntax but for a normal application GUI. It's very interesting to play with, and you'll learn some javascript in the process of not-writing-web-pages. |
|||
|
|
|
JavaScript can be used for "out of the box" shell scripting on both windows and mac: In my opinion, on Windows it's the most palatable choice, because the alternatives are VBScript and BAT files (at least if you can't rely on additional installs). |
|||||
|
|
It is not worth learning beyond the basics. Even if you work in web applications, but in the backend, devote your learning resources in subjects more related to your field. Javascript is just another language with no special message that will enrich you significantly. |
|||||||
|
|
I'd say that a language with dynamic and functional capabilities is worth learning, but it needn't necessarily be Javascript. LISP is takes the above concepts much farther than Javascript, and is thus considered an excellent language to learn, even if you never need to use LISP itself. |
|||
|
|
|
While Javascript is a full language syntactically,object oriented, etc., it does mostly lack libraries to interface with stuff not already built in. It is well purposed for accessing and modifying XML data, for example, but doesn't really provide many interfaces to hardware. This question on Stack Overflow addresses some examples of where it is and can be used outside web programming. |
|||
|
|

spidermonkeywhich is Mozillas javascriptparser. It's also standalone and can be used in any application. – jgauffin May 9 '11 at 10:46