News for hackers. Stuff that matters.
Re:We switched to Node.js: the good and the not so good by nicholassmith on Monday January 14, 2013 @06:58AM (#5054296)
I tried Node, because it was the new hotness and trying new things is great. It was distinctly Not For Me, for many of the same reasons that they've found; many tutorials are out of date in subtle ways (I like to think of this as the Rails effect from way back in the good old fun days), the language is just painful to structure and read over for my syntax processing.

There's definitely a lot to like, and like they said it's still a very new world with a lot of exploration to be done.

Re:We switched to Node.js: the good and the not so good by blacktulip on Monday January 14, 2013 @07:07AM (#5054314)
I have not tried Node (or in fact JS as a whole) yet. But it seems very hard to avoid JS in these days. I am going to learn it in a few months. Can anyone give me a rough idea how bad it is? (I know some Obj-C so is JS worse than that?)
Re:We switched to Node.js: the good and the not so good by PommeDeTerre on Monday January 14, 2013 @07:52AM (#5054420)
Coming from Objective-C first, which is generally a rather sensible language, I think you'll be surprised at how stupid, unnecessary and inexcusable many of JavaScript's problems are.

People who only have a PHP background, for instance, have become accustomed to such stupidity. They think it's "normal", solely because they don't really know any better.

Those coming from C, C++, Java, C#, Ruby, Python or most other languages, on the other hand, know that the JavaScript way is not the right way. These people generally have a much harder time coming to terms with JavaScript's numerous issues.

Re:We switched to Node.js: the good and the not so good by pkorzeniewski on Monday January 14, 2013 @08:41AM (#5054562)
It's not that JavaScript is a bad language, it's just easy to write bad code in JavaScript. I don't get it why most people coming from languages you mentioned like to bash JS so much, I used most of these languages in the past or use them currently (mainly Java and Python) and I like JavaScript the most. The problem is most people just don't want to learn JS, they write shitty code because it's easier and than complain how bad the language is. Sure, there are many issues with the language itself, usually because of how flexible it is, but for almost every issue there is a 'good way' of dealing with it.
Re:We switched to Node.js: the good and the not so good by mattmanser on Monday January 14, 2013 @08:49AM (#5054602)
Unless you are lucky enough to work on only your own code, that it's so easy to write bad code is a massive problem.

My big beef with js is that there's no 'right' way to lay out your code. Trying to figure out how a js module works is always a unnecessarily massive pita.

Re:We switched to Node.js: the good and the not so good by partomniscient on Tuesday January 15, 2013 @03:29AM (#5059289)
>It's not that JavaScript is a bad language, it's just easy to write bad code in JavaScript.

In my mind, that alone makes JavaScript a bad language.

Re:We switched to Node.js: the good and the not so good by matwood on Monday January 14, 2013 @11:18AM (#5055217)
I too have been surprised at all of the frameworks coming out for JS to be on more than the browser. From my experience large JS projects are a pain to write and maintain. It's a neat language, but I don't really get why I would want to write my server code in it.
Re:We switched to Node.js: the good and the not so good by nicholassmith on Monday January 14, 2013 @08:26AM (#5054503)
I think that's my biggest problem, my background is heavy on C/C++, and moved onto C#, Ruby, Python and Obj-C later and whilst I think Javascript is fine in terms of providing functionality for web pages, the language doesn't lend itself to a large implementation like NodeJS unless you're supremely well versed in it.
Re:We switched to Node.js: the good and the not so good by drewmck on Monday January 14, 2013 @08:13AM (#5054472)
I was speaking with a colleague about Node and he suggested using Coffeescript instead of JS directly for the exact reasons you mentioned.

I'm also coming from Obj-C, C and Ruby background and recently read "Javascript: The Good Parts". I'm still looking for the good parts promised in the title and introduction.

Re:We switched to Node.js: the good and the not so good by damncabbage on Monday January 14, 2013 @08:31AM (#5054511)
dagw has the best response to this below: http://news.ycombinator.com/item?id=5054382

I agree; it's a shortcut for people who know JS, not for people who are learning it for the first time. As soon as you need to use or look into the internals of a library that isn't written in CoffeeScript, everything's going to get unstuck pretty quickly.

Re:We switched to Node.js: the good and the not so good by calibraxis on Monday January 14, 2013 @09:41AM (#5054778)
I personally happen to disagree. (I have production/team experience with both node.js and CoffeeScript.)

For many learning types, I'd guess it's preferable to leisurely learn JavaScript from the shores of CoffeeScript. Rather than having to deal with all of JavaScript's absurdity at once.

And when you need to read someone else's JavaScript code, you can usually get away with ignoring boilerplate.

Re:We switched to Node.js: the good and the not so good by dagw on Monday January 14, 2013 @07:34AM (#5054369)
Instead of worrying about how bad JS is, read JavaScript the Good Parts and Effective JavaScript and focus on how good much of it is. Yes, JavaScript has oddities and there is a quite short list of pitfalls you have to learn to avoid ('==' vs '===' for example), but it also has some very powerful features. Take the time to actually learn actual JavaScript, as opposed to assuming that it's basically a bad Java (or whatever) with slightly different syntax and you'll find a pretty neat and powerful language.
Re:We switched to Node.js: the good and the not so good by vardump on Monday January 14, 2013 @07:59AM (#5054440)
Javascript is overall cleaner than Obj-C. Both languages can of course be used and abused in many ways. Javascript is going to require less code in general. On the flipside, larger projects are harder to keep maintainable.

There are some trivial gotchas in Javascript, but same can be said for most languages. Most importantly weird type promotion system, variable & function hoisting and prototypal inheritance can cause some gray hairs. All those can be lived with, and prototypes are in some ways superior to "classical" inheritance.

C, C++, Java, Javascript, Lua(JIT), Perl and ObjC are languages I normally use.

Re:We switched to Node.js: the good and the not so good by superbobry on Monday January 14, 2013 @07:16AM (#5054330)
[1] can give you some insight on the dark side of JS. Also, avoiding JS in some way or another is not that hard, esp. since there're a lot of languages which compile to JS, most notably CoffeeScript and ClojureScript.

  * [1] http://wtfjs.com 
  * [2] https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS
Re:We switched to Node.js: the good and the not so good by dagw on Monday January 14, 2013 @07:38AM (#5054382)
As much as I love CoffeeScript, it's not a substitution for learning JavaScript. CoffeeScript is basically just JavaScript with a prettier syntax and if you don't understand JavaScript you won't understand CoffeeScript.
Re:We switched to Node.js: the good and the not so good by cometc on Monday January 14, 2013 @09:02AM (#5054644)
That is completely true, you can't treat CoffeeScript as a replacement for learning Javascript in fact I'd say you need to have a pretty strong understanding of JavaScript to really use CoffeeScript well. That said CoffeeScript does some nice things to prevent typical small js errors for newer devs.
Re:We switched to Node.js: the good and the not so good by pooriaazimi on Monday January 14, 2013 @08:48AM (#5054597)
Very true. I love CoffeeScript very, very much. It's my favorite language - I like it even better than ruby, if you believe me! I like using indentation instead of stupid 'end's that only God knows are ending a loop or a def or something else, I like the use of ... instead of * (for splats), and a few other things.

But, as much as I like CS and hate (really hate) JS, I have to agree with you wholeheartedly. You must know JavaScript well. Variable/function hoisting won't bite you in CS, but other JS idiocies will.

Read Douglas Crockford's "JavaScript: The Good Parts" at least twice (and take a lot of notes). It's the best no-bullshit book on JavaScript (the language, not "how to use JavaScript in Node/front-end web design") around.

Re:We switched to Node.js: the good and the not so good by codygman on Tuesday January 15, 2013 @01:31AM (#5059030)
If you like how CoffeeScript is tab delimited, you might also enjoy python.
Re:We switched to Node.js: the good and the not so good by chrismsnz on Monday January 14, 2013 @05:12PM (#5056997)
Pick up "Javascript: The good parts" by Douglas Crockford and don't look back.