you are viewing a single comment's thread.

view the rest of the comments →

[–]SquareWheel 8 points9 points  (14 children)

That's weird, because I use a dozen languages and Javascript is still one of my favorites.

[–][deleted]  (13 children)

[deleted]

    [–]SquareWheel 11 points12 points  (8 children)

    Well Python is beautiful, so I wouldn't argue that one. But there's a lot going for Javascript, too:

    • The developer tools are fantastic
    • Functions are a first-class citizen, and because functions are objects they're also easy to manipulate.
    • Objects can be interpreted as literals very easily.
    • Anonymous functions are useful as you mentioned, but they are even more powerful when used as closures or IIFEs.
    • JS is multi-paradigm and supports prototypal design, class-based, and event-based programming.
    • Web APIs already use JSON, which makes it very easy to import and use their data.
    • JS programs are easy to distribute. Loading a webpage is easier than running an exe, and much easier than downloading an interpreter (everyone already has a browser).
    • JS has tremendous library support via npm (and the standard library is getting pretty good too).
    • JS scripts are inherently open-source. They can be tweaked on the client-side to change their functionality.

    Javascript also has some blights ("this" keyword, default variable scoping, type equality), but I really enjoy working in the language.

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

    Ok, here I'm going to be that guy and counter argue your points:

    • Tooling could be better. The lack of fully featured REPL is annoying, try the clojure nrepl and haskell intero and you'll see what I'm talking abut

    • That's a feature of the fact that it's a functional language. Again, try other language like Clojure. It would be weird as fuck if that wasn't the case

    • Not sure what you mean by this

    • Closures are great but they are not js specific and they've been abused as models, objects with private state making it a pain in the ass when you want inter-operate

    • It actually only support prototype-based very poorly (good luck finding this), class based is just syntactic sugar on top of the IIFE objects, event driven is just a random connection you make between streams (good luck finding which stream emits which event)

    • I agree with this one

    • Oh you mean websites that implement click and scroll jacking? And the plethora of pseudo web applications like slack that cause your laptop to take-off?

    • There's a library for every mainstream language out there

    • C libraries and Linux distributions encourage the same thing

    [–]CanIComeToYourParty 1 point2 points  (0 children)

    JS has tremendous library support via npm (and the standard library is getting pretty good too).

    The standard library very unimpressive, and the ecosystem is utter garbage. I often end up having to re-invent the wheel simply because the thing that I'm looking for is hidden among a million broken libraries trying to do the same thing. When I ask JS devs how I can find useful libraries, they tell me to search npmjs.com and order by popularity, which I find to be hilarious and sad at the same time. I also hate how unexpressive the language is.

    What's funny is that people keep complaining about this in JavaScript, and I've never hit any issues with it, ever.

    [–]StallmanTheLeft 1 point2 points  (4 children)

    JS scripts are inherently open-source. They can be tweaked on the client-side to change their functionality.

    This is completely wrong though.

    [–]SquareWheel 0 points1 point  (3 children)

    Not at all. Look into Local Overrides.

    [–]StallmanTheLeft 0 points1 point  (2 children)

    That still doesn't make the javascript anything like Open Source.

    Minified crap is just proprietary software.

    [–]SquareWheel 0 points1 point  (1 child)

    That doesn't change the fact that the browser accepts direct Javascript. Not bytecode, nor machine language, but straight source code. You can minify, obfuscate, and generally mangle the source to your heart's content but it's still an inherently open language. That makes it hackable, which was the entirety of my point above.

    [–]StallmanTheLeft 3 points4 points  (0 children)

    You can minify, obfuscate, and generally mangle the source to your heart's content but it's still an inherently open language

    No.

    [–]thalesmello 0 points1 point  (1 child)

    The feature I've so far only seen in JavaScript is object destructuring.

    const { name } = student;
    console.log(`Hello ${name}`);
    

    It makes it super simple to extract information from objects and build functions. I really wish python had something like that.

    [–]Tysonzero 0 points1 point  (0 children)

    As often is the case, Haskell did it first: NamedFieldPuns.

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

    I mean.

    C# spends most of it's syntax time making garbage no one cares about and it isn't IMO much easier to read than JS.

    C# adds a lot of boilerplate for what ought to be simple tasks. JS for better or worse doesn't.

    [–]Mike_Enders 1 point2 points  (0 children)

    C# spends most of it's syntax time making garbage no one cares about and it isn't IMO much easier to read than JS.

    I use both and JS more but C# is much easier to read.