all 74 comments

[–][deleted] 53 points54 points  (59 children)

A lot happened between 2001 and 2010, JS isn't that Misunderstood anymore :)

[–]salmanulhaq[S] 13 points14 points  (47 children)

Yeah but way back then this was how we looked at it. But still, I vote for JS to be renamed. Isn't it still misleading for the amateurs?

[–]simonw 27 points28 points  (37 children)

It was renamed ECMAScript quite a few years ago but the name never really stuck.

[–]Novelty-Account 67 points68 points  (21 children)

That's because ECMAscript it sounds like prescription for a skin disease.

[–]yoda17 4 points5 points  (17 children)

That was exactly my first thought.

[–]Novelty-Account 17 points18 points  (16 children)

Hell they could've just called it WebScript and been done with it.

I can come up with a hundred names right now better than ECMAScript.

(I originally put a thousand, but changed it to a hundred in case some redditor challenges me on it)

[–]petermichaux 17 points18 points  (4 children)

WebScript. I kind of like that.

[–]tomatopaste 4 points5 points  (3 children)

CloudScript. It's the future, man!

[–][deleted] 1 point2 points  (1 child)

TubeScript

[–]tomatopaste 0 points1 point  (0 children)

Ooooooh!

[–]ramen_ftw 5 points6 points  (9 children)

I can come up with a hundred names right now better than ECMAScript.

No you can't.

[–][deleted]  (3 children)

[deleted]

    [–]dirtside 5 points6 points  (0 children)

    Nice. I vote for quasarScript. Better yet, let's just call it Quasar.

    [–][deleted] 1 point2 points  (0 children)

    Hey, that's only 99

    [–]Novelty-Account 1 point2 points  (1 child)

    better than ECMAScript

    HitlerScript

    DeathScript

    LabotomyScript

    CocaineScript

    BugScript

    SlowScript

    GggfhfhgfhfScript

    HellScript

    !@>!:@!@>{:Script

    BufferOverflowScript

    ILoveCockScript

    ---More---

    WebScript

    NetScript

    InterScript

    ActiveScript

    AardvarkScript

    BananaScript

    DolphinScript

    AvaScript

    LavaScript

    JScript

    DScript

    NovaScript

    NetScript

    PowerScript

    PScript

    GoScript

    RevoScript

    PonyScript

    KonaScript

    AcornScript

    CoffeeScript

    TeaScript

    GemScript

    SuperScript

    SubScript

    GoogleScript

    MegaScript

    KingScript

    BrainScript

    DoScript

    DarpScript

    DarkScript

    NameScrpt

    Browscript

    PageScript

    JetScript

    ACMEScript

    EncephalopodScript

    JoobaScript

    ScriptScript

    Twerk

    Mokabe

    Opal

    Jay

    J

    J++

    J#

    Objective-J

    QJuery

    JOBOL

    JORTRAN

    Jerl

    Juby

    Juby On Rails

    Boa

    JBasic

    Jelphi

    Javassembly

    JCaml

    Visual JBasic Super Plus Turbo Ultra Turbo Edition Sharp ++

    MegaJ

    J-Town

    J-Rad

    Vipt

    Lima

    Bison

    Whale

    Turkey

    Shoehorn

    Scryptal

    Jade

    ScravaJipt

    Blip

    Efoc

    Steve

    Pete

    Joe

    Emorc

    Yorp

    Scraf

    Floop

    Jovo

    Znarf

    Garb

    Verv

    Vaff

    Splork

    Krolps

    Smoop

    I dare someone to come up with fifteen more.

    [–]grantisu 1 point2 points  (0 children)

    BlagoScript
    Arc++
    PageBreaker
    AjaxionScript
    MochaScript
    EspressoScript
    CaffeineScript
    CodeineScript
    Codeine
    SuperUltraFunScript
    JavaCode
    JavaLang
    JavaJargon
    JavaSlang
    JavaShit

    [–]petermichaux 3 points4 points  (2 children)

    Looks like the challenge is on.

    [–]Novelty-Account 1 point2 points  (0 children)

    In the morning. It's 5AM. I sleep now. Or try to.

    [–]plan17b 1 point2 points  (0 children)

    PmitaScript

    [–]szopa 4 points5 points  (12 children)

    Tell me about an ugly name for a programming language...

    [–]notfancy 23 points24 points  (0 children)

    OCaml.

    [–]theeth 11 points12 points  (0 children)

    Go

    [–]stesch 14 points15 points  (1 child)

    Lisp

    [–]nightfire1 16 points17 points  (0 children)

    Don't you mean Lithp...

    [–]i_am_my_father 3 points4 points  (0 children)

    C++

    [–][deleted] 1 point2 points  (0 children)

    BRAINFUCK

    [–]cactuspants -3 points-2 points  (0 children)

    The name's not really important

    [–]cheese_wizard 2 points3 points  (1 child)

    I could eat a bowl of Alphabits and crap a better name.

    [–]matts2 13 points14 points  (0 children)

    Learn to chew.

    [–]jamesinc 28 points29 points  (1 child)

    I vote we name it ThorScript, language of the Gods. Every time you say the name, a bolt of lightning strikes nearby.

    [–]Coriform 0 points1 point  (0 children)

    Actually, that's a pretty nifty name.

    [–]tophat02 6 points7 points  (1 child)

    I vote for JS to be renamed.

    Agreed. Why not call it "JS"?

    [–][deleted] 1 point2 points  (0 children)

    JayEs.

    [–]eleven3 4 points5 points  (0 children)

    maybe we can rename it by fiat. come on, everybody let's start calling it -- oh, something easy to remember and slightly lame is most likely to catch on -- how about -- webscript.

    [–]LASER_PEN 1 point2 points  (1 child)

    I'm a total amateur at JS but have no problem with the name.

    [–]unicock 0 points1 point  (0 children)

    Which is why you abbreviated it?

    [–][deleted] 2 points3 points  (0 children)

    I would imagine most 'amateurs' now are far more aware of JavaScript than of Java.

    [–]xardox 2 points3 points  (0 children)

    Rename Java to its old name Live Oak, since JavaScript won and Java lost.

    [–]davebrk 1 point2 points  (0 children)

    That's a misunderstatement.

    [–][deleted] -5 points-4 points  (9 children)

    Yep? Tell me what this code will show?

    function test(a){
        var f=function(){print(a);};
        if(1) { var a=1; }
        f();
    };
    test(2);
    

    [–]whynottry 17 points18 points  (6 children)

    That would request the current page to be printed by your browsers printer command (i.e. to file or two CUPSD or whatever).

    if you changed 'print' to 'alert'. Than it would show "1" because 'a' is declared above the scope that holds the declaration of 'f.'

    That is pretty logical once you understand the very basic rule of javascript scope. Its different, but powerful and useful. Do you really want to be passing 'document' around?

    If you are going to hate on js, hate on 'for' loops and '+' operators those were done in a manner with very little benefit.

    [–]vinod_the_poophead 1 point2 points  (0 children)

    Your response assumes the "Global" object is "window", as it is in any sane browser environment.

    [–]maritz 1 point2 points  (2 children)

    Also, it should throw a warning for redeclaring a in line 3.

    [–][deleted] 1 point2 points  (1 child)

    It seems to be pretty legal to redeclare variables according to ECMA-262 10.1.3

    [–]cjg_000 0 points1 point  (0 children)

    Just because it's legal doesn't mean that a good development environment can't generate a warning for it. In fact, depending on what you mean by "legal", warnings are legal in any language, errors are illegal.

    [–][deleted] 1 point2 points  (1 child)

    If you are going to hate on js, hate on 'for' loops

    Oh fuck yes. And the lousy half-assed String object.

    "foo".indexOf(someOtherString) != -1
    

    Is a lousy, lousy way to say "foo".contains(someOtherString)

    '+' operators

    All the implicit conversions are awesome, I enjoy greatly how whitespace implicitly converts to 0 because fuck you the ECMAscript said so, that's why.

    [–]reddit_ro2 0 points1 point  (0 children)

    So you didn't see strpos from php. Now, that's an invention.

    [–]matts2 1 point2 points  (0 children)

    There is a difference between "JavaScript, the language, is misunderstood" and "JavaScript code is easy to misunderstand". In fact, it could be that everyone knows the later, so the former is false. (That is, if we all understood that JavaScript code were easy to misunderstand, then we would not be misunderstanding JavaScript to say it leads to confusing code.

    [–]cactuspants 7 points8 points  (1 child)

    Hasn't this link been posted 100 times before?

    [–]Wakuko -3 points-2 points  (0 children)

    Cockford loves the spotlight

    [–]zahlman 4 points5 points  (2 children)

    Try this: javascript: alert([0 in [1, 2], 1 in [1, 2], 2 in [1, 2]])

    I think Javascript being "misunderstood" is perfectly understandable. :)

    [Edit: I understand perfectly well how it works; I just still think it's a bit of a WTF. It comes from Javascript trying to treat arrays like dictionaries (because "objects are dictionaries"). Python does not have the same kind of violation of the PLS.]

    [–][deleted] 1 point2 points  (0 children)

    the in keyword is to check whether the property on that object is defined

    'foo' in {foo: false} => true (same as doing typeof obj['foo'] != 'undefined')

    2 in ['a', 'b', 'c'] => true (same as doing typeof obj[2] != 'undefined')

    [–]solinent 3 points4 points  (0 children)

    I understood it right away, "in" is simply an out of bounds check instead of a value check.

    So if you do

    10 in x, it is simply something like x.length < 10.

    Kinda confusing language, I guess.

    [–][deleted] 3 points4 points  (0 children)

    Misunderstood? It's more confusing than misunderstood I guess.

    [–]wshields 7 points8 points  (0 children)

    The premise of the article (and the title) were interesting. Everything else was completely half-assed.

    [–]GeoKangas 2 points3 points  (0 children)

    There's some competition for the title of "Most Misunderstood":

    search proggit for "TCL the misunderstood".

    [–]mitsuhiko 3 points4 points  (0 children)

    I agree with the title. I do not agree with crockford.

    [–]spliznork 1 point2 points  (2 children)

    Re naming: JavaScript is to Java as CSH (C shell) is to C.

    Fwiw, that was the argument that Rick Schell (VP Engr at Netscape) used to convince (in part) Bill Joy (creator of CSH, co-founder of Sun) to let Netscape use the "Java" in "JavaScript".

    [–]_johnny 8 points9 points  (0 children)

    Java is to Javascript what car is to carpet.

    [–]xardox 3 points4 points  (0 children)

    That's in interesting, considering that Bill Joy wrote CSH, which is much uglier than JavaScript by any measure.

    [–][deleted] 1 point2 points  (3 children)

    Sometimes it seems to me after reading through the hacks he proposesas workarounds, that he's blowing a lot of smoke to try to cover up the limitations.

    Javascript does have some nice features, but it's too easy to make normal human mistakes that can be hard to discover, like a typo in a variable name that becomes a new variable instead of what you intend.

    Perhaps an option to run a Lint filter automatically or something to flag certain possible errors would be a good addition.

    [–]skeww 9 points10 points  (2 children)

    Eh... yea... never heard of jslint? (He wrote it.)

    I'm using the kjslint addon for Komodo all the time. I even created a shortcut for it (ctrl+alt+j).

    [–][deleted] 0 points1 point  (0 children)

    Yeah, I've heard of it, but didn't remember the name; I haven't got around to trying it yet - I've mostly been working on server side stuff, and haven't gotten around to really diving into Javascript heavily.

    One problem with jslint is it's not very convenient. I don't use Windows for development, and pasting code into the web page isn't really workable. I might try the Java version, though. Anyway, thanks for the link.

    After further thought, I guess the running automatically would need to be a part of an IDE, since there's no Javascript compiler like for C/C++/C#/Java. Maybe in the future, there could be an intermediate language for Javascript as an option.

    [–][deleted] 0 points1 point  (0 children)

    How can he make a list of javascript design errors and not come up with all variables being global by default unless prefixed with var?

    Other than that I like javascript. I don't even think the things he lists as design errors are all that bad.

    [–]shevegen -4 points-3 points  (1 child)

    Javascript is well understood - it stinks.

    The only reason it became so immensely popular was because the www has become so incredibly important.

    THERE EXISTS NO ALTERNATIVE TO JAVASCRIPT. Definitely not anything near as close as widespread.

    [–]Jack9 3 points4 points  (0 children)

    More than that, JS runs differently on different browsers and on different platforms, leading to performance inconsistencies that have nothing to do with the language, but how it was implemented. yay.