Hacker News new | past | comments | ask | show | jobs | submit login
Crockford on JavaScript (yuiblog.com)
70 points by inshane on Aug 22, 2011 | hide | past | favorite | 17 comments



I don't always agree with all of Crockfords opinions (I don't believe the ++ operator to be harmful for example) but I do think that his lectures are brilliant.

In fact, his previous lectures at yahoo somewhere around 2007ish have fundamentally changed how I think about JavaScript: what was bad spaghetti once, became real architecture. What I felt was an ugly language became a cool language with some warts.

Crockfords lectures began a long process to convert me from "who needs functional programming" to "why does this method here have side effects?" (a route many programmers are probably taking, but for me was the beginning of the journey)

And finally, even if you think that you know all about JS, these lectures are still very entertaining to watch, because, IMHO, Crockford is a brilliant speaker.


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.


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.


But why that pro-space bias? I've always preferred tabs.


Because different editors handle them wildly differently but spaces are totally unambiguous.

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


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.


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.


I am learning Javascript, and following Crockford to do so. But one thing scares me: The Yahoo page is essentially unusable to me unless I turn off Javascript. It bogs my machine down (not that old, a couple of years and 4 gb of ram).

I don't want my site to behave like theirs. Is he somehow responsible for their site's architecture? I have trouble with both yahoo.com and my.yahoo.com- which I used to use quite a bit.


Crockford didn't even work for Yahoo until sometime after 2002, long after the Yahoo site had been built out. And I believe he works there in "senior member of the very wise tool-building research staff" mode. Based on the biographical sources I've seen, I don't believe he's officially in charge of the YUI library, yet alone any of the rest of Yahoo.


That's a relief.


I loved the way he explained closures and IE 6 memory leak problems in event handling.


More talks by Crockford, including this series: http://yuilibrary.com/theater/douglas-crockford/

For something completely different, check out Project Future, Crockford's lecture on Walt Disney's dreams.

Scene 6 from the JS series also has slides and Flash video available: http://yuilibrary.com/theater/douglas-crockford/crockford-lo...


To piggy-back off what reid contributed, here is Crockford's website containing a lot of his essays on JavaScript and a calendar of his past & upcoming speaking events:

http://www.crockford.com/

He's also been active on Google+

https://plus.google.com/118095276221607585885/posts


JavaScript is one language where opinions are built not purely based on technological consideration but also a lot of politics. Best part is no matter what who think about the language, you don't really have a choice.

Most of the javascript programmers today are merely copy-paste JS programmers who basically just copy paste some iQuery code and modify to suite their own project.

A lot of credit goes to Cockford for popularizing Javascript as a core languages and sensitzinf programmers about the differences it shares with other programming languages.


> world's most popular programming language

I don't even ...


In this case popular does not specifically mean well liked, simply widely used. Consider the mass of people cut and pasting together web sites who touch javascript, and virtually every modern, internet connected device is capable of parsing and executing javascript.

Edit: For the record, I personally really like javascript, since exposing myself to crockfords evangelism and picking up node.js.


Great series, but he 'ummms' way too much and I couldn't help but notice it.

(Edit: it gets better later on)




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

Search: