Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm a backend programmer who works mainly in Python. I'll probably never want to be a full time front end developer, but with the goal of growing my skill set, I would like to become at least passably proficient in JavaScript. It seems like a language that is wearing a lot of hats nowadays, and if nothing else, I'd like to a little more knowledgable about 'their world' when I'm working with front end guys.

We're using NodeJS for some server side work at my company, and I was curious about it. I've found a few good tutorials and it seems interesting. It seems like it might be a good way to familiarize myself with JavaScript, since it comes at it from an angle that I understand -- server side programming.

But I am also a little worried that if I learn both at once, I won't be able to keep track of what's 'Stock JavaScript' vs features that are particular to NodeJS.

What do you guys think? Is bootstrapping myself into JavaScript familiarity by learning NodeJS a good idea? Or will I just confuse myself if I jump into Node without a solid understanding of the fundamentals of JavaScript?

share|improve this question

closed as not constructive by Walter, Kirk Broadhurst, gnat, Mark Booth, Martijn Pieters Jan 22 '13 at 11:19

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
To those who closed my question: I am deeply confused as to what was wrong with this. This was NOT "What's better? client side JS or Node JS?" Nor was it "What should I learn next"? (I know I want to learn JS, and this was merely a request for advice on HOW). It can be (and was) answered with illustrative experiences and technical knowledge. I was specifically instructed to ask this question here after I (improperly) asked it on SO. This question can be answered concretely (Yes, its fine, or no, you'll get confused). It's not open ended. Please help me understand the problem with it. –  Clay Wardell Jan 22 '13 at 15:28
    
There was some 'open ended discussion' beginning to happen in the comments, but this was based on answerer's characterization of JS itself, which is not specifically what I asked for. There seemed to be general consensus on the main point of my question, which is that learning NodeJS is an acceptable route towards learning JS. –  Clay Wardell Jan 22 '13 at 15:30
    
This question is being discussed on our Meta site, feel free to join in. –  Yannis Rizos Feb 23 '13 at 0:00

4 Answers 4

It won't matter.

In either case, you'll be learning things that are specific to the domain in which you're working. On the client, you'll be learning things about DOM and cross-browser compliance. On the server-side you'll be learning things like file access and database libraries.

It's really six to one, and half-dozen to the other. If anything, you'll be less distracted by the the intricacies of Node than you will the intricacies of browser-based JavaScript.

share|improve this answer

Getting into JavaScript is definitely a good idea, as JavaScript is only getting better and more popular.

Front-end JavaScript development is extremely different then Node.js (Server-side) programming/development. Each browser has their own support of JavaScript features, meaning, features are not always readily available across every browsers. Especially with the new version of ECMAScript, it's becoming extremely hard to take advantage of, as most browsers, or the majority of users (apart from chrome) are on older browsers. Chrome has had auto-updates for a long time, so it's users don't need to take any action. They typically get the majority of their users upgraded within a few weeks. You still have Internet Explorer 6,7, and 8 problems, and even 9 (Not many new features that are in HTML5 and ECMAScript spec). Firefox is fairly good, and they seem to be on a good track implementing new features all the time.

On the client-side you have 3-5 different JavaScript engines; V8 (Chrome & Node.js), IonMonkey (Firefox has had multiple engines), Carakan (Opera), JavaScriptCore (Safari), Chakra (Internet Explorer). Each engine has different architectures (JIT, byte-code, machine code, etc...) and now each have different support for ECMAScript 6 (Harmony).

With Node.js, you can start to take advantage of newer JavaScript features as you only have to support one JavaScript engine (V8). This makes it extremely easy to work with, as you're not jumping through hoops trying to do feature detection, hack the system, etc...

Lesson 1: Developing within Node.js is luxury compared to the client-side, but with the power of frameworks and libraries like JQuery, Ember.js, Angular, Handlebars (Templating), Modernizr, etc... your work load dramatically decreases.

Performance, Optimization, and the DOM... This is what client-side development is like. If you start with Node.js, you'll start to use (hopefully) build and deploy tools like GruntJS, Yeoman, Cake, etc... These will be incredibly useful when working with client-side JavaScript. Start looking into different module systems; Node.js uses CommonJS. AMD is another choice for development.

JavaScript as a language is simple to get started with. Once you dig deeper down, you'll find how flexible a prototypal model is.

The asynchronous model might be a little scary at first, but no need to be afraid. It's quite simple when you understand it. You'll go through the traditional stage of callback hell, but you'll be able to learn some design patterns to avoid them.

share|improve this answer

Node essentially capitalizes on all the stuff that makes JavaScript stand out as a language so I'd say it's probably a better start than client-side work for you. Also, Python's trust-the-user philosophy and the Python community's devotion to writing cross-platform software that isn't clumsy, hamfisted and stupid tends to be a good fit with JavaScript's complete abandon with regards to giving its users plenty of rope to do with as they please and the JS community's legacy of normalizing for browsers that refuse to agree on how things are done exactly fits nicely with that Python-cross-platform chutzpah.

So I guess what I'm saying, is that I wouldn't sweat it. You've got the server-side paradigm down and Python and JS, while different, tend to come from similar lines of thought which I would boil down to:

  • Don't protect me from myself or the other guy
  • Don't assume I'm a dummy or that I'll never want to learn anything after college
  • Be easy to use right out of the box but give me serious power when I bother to really learn the crap out of the language and what it's capable of

The important thing to remember about JavaScript is that in spite of what all the bigwig speaking-engagement-types say, JS is not a language we are "stuck with." It is not something that happened to dominate web UI and then spread across all platforms like a super-virus by accident. It did not kick the crap out of VB, Flash, ActionScript and Java applets merely because of foolishly misguided efforts at owning the front end of the web by abstracting from how everything actually works, or being intolerably proprietary in terms of how those language business models were in their own right completely and 100% unacceptable. And it sure as Hell isn't the only real choice for writing cross-platform mobile platform apps just because JS devs are hyperactive and prolific. It won those battles because it's a really good tool for those jobs.

It's elegant, it has a strong, highly-focused opinion, and it walks a nice line of being accessible to people who just want to get simple things done in obvious ways while offering very powerful options to people who are willing to take it a step further and properly understand how it fuses functional and functionally-OOP into a master-blend.

And remember that the whole point of Node.js is to basically bury threads with JavaScript. You can run two I/O processes simultaneously but JS is just the thing that sets processes off and waits for them to finish. The fact that the language is naturally blocking but highly proficient at asynchronous response essentially turns JS into a kind of auto-queuing messenger. It's probably not the best tool for everything you'd ever want to do on a server but it's a pretty interesting paradigm for a lot more than just covering basic web server stuff. But not if you don't accept it for what it is and why that's been successful. So, have fun with it. Learn more about Python as you learn more about how JavaScript is different from it.

And sorry about the C-based syntax. You won't notice as much after a while, I promise. But skip CoffeeScript until you know how it limits you on the OOP front. You probably won't want it.

share|improve this answer

JavaScript, by itself, is a pretty small language that is easily understandable by most programmers, especially if you're a proficient Python programmer. There are no new programming concepts in core JavaScript. You probably already know 90% of what there is to know about JavaScript itself.

The real learning curve comes when you use JavaScript to try to do some useful work. Inside a browser, you use the DOM (Document Object Model) to interact with web pages. That is sometimes annoying, so you can also use jQuery to manipulate the DOM with shorter expressions.

NodeJS is a way of writing back-end server processes in JavaScript using a highly asynchronous programming model. Unless you're using Twisted in Python, you're probably not going to be very familiar with the asynchronous style of programming used in NodeJS. So that would be another learning curve.

Basically it depends on what you want to actually do with JavaScript - it's just a programming language tool. The libraries that people build around JavaScript are where the interesting things happen.

share|improve this answer
1  
The first part of your answer is completely incorrect, considering that there are numerous pitfalls to the language (due almost entirely in part to horrendous design choices) which a lot of people won't know about without reading about them. I recommend reading Effective Javascript and then coming back with the same opinion. Most people rush into JavaScript thinking that "it's just like every other language" -- the basic elements are there, but beyond that it's quite unlike any of the others. –  Cuttooth Jan 22 '13 at 2:27
1  
Sure, there are gotchas in JavaScript, just as there are gotchas in Python (and every other programming language). These are not new concepts, but are just things you need to watch out for while you're learning a new language. –  Greg Hewgill Jan 22 '13 at 2:30
    
+1 An acquaintance of mine recently said he was going to learn JavaScript because then he could do both front and back end development. I had to laugh - the language is the easy part to learn; the hard part are the APIs, frameworks and platforms that the language runs against. The client and the server are completely different. –  Kirk Broadhurst Jan 22 '13 at 3:02
1  
-1 for the first part about being just like everything else, JavaScript is practically a lisp and quite unlike python or most other imperative languages in this way. –  Jimmy Hoffa Jan 22 '13 at 3:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.