News for hackers. Stuff that matters.
Re:Crockford on JavaScript by stephenr on Monday August 22, 2011 @02:36AM (#2911591)
Agreed - I think he has improved people's perception about JavaScript, but people who blindly follow what Crockford says are worse than the copy-paste javascript developers of the late 90s.

I too disagree with him about several things - these two off the top of my head:

* White space - real tabs are much easier to work with than spaces

* new Operator - a) we can automagically return a new instance if the constructor is called normally and b) even if we couldn't, that's no reason to stop using a major part of OOP.

Re:Crockford on JavaScript by lawnchair_larry on Monday August 22, 2011 @05:55AM (#2911956)
The anti-tab movement is not specific to Javascript. Most languages have adopted this position, and most IDEs expand tabs to spaces by default now.
Re:Crockford on JavaScript by aaronharder on Monday August 22, 2011 @07:07AM (#2912076)
But why that pro-space bias? I've always preferred tabs.
Re:Crockford on JavaScript by mattmanser on Monday August 22, 2011 @07:26AM (#2912118)
Because different editors handle them wildly differently but spaces are totally unambiguous.

With spaces there's no sudden, 'woah, what happened there'.

Re:Crockford on JavaScript by __david__ on Monday August 22, 2011 @02:53PM (#2913601)
Because there are times when you need to indent to something that isn't a main indentation point, like this:

    some_function_with_too_many_args(some_argument, another,
                                     a_third, and_so_on);
That style is problematic with tabs. The only way to make that look right with all different tab settings (8, 4, 2, etc) is to mix tabs and spaces--indent to the main indentation level with tabs and then use spaces to indent the rest of the way. Not many editors do that automatically for you and so it is not a popular style.

All spaces is much easier to deal with (at the cost of being non-customizable) and so that seems to be the dominant way of doing things nowadays.

Re:Crockford on JavaScript by barkmadley on Monday August 22, 2011 @02:59AM (#2911641)
For me, the new operator (in javascript) is an optimisation, so it should be inserted into a code base after profiling. In accordance with the "make it work, make it right, make it fast" philosophy of development.