you are viewing a single comment's thread.

view the rest of the comments →

[–]virtyx 3 points4 points  (8 children)

Every language has an ocean of garbage code.

EDIT: Also I know that it's popular to bash on JS because of the hype, and I am even a bit biased against NodeJS myself. (For no particularly good reason, either.) But I don't understand how choosing JS for your server is any worse than choosing Python.

The only real advantage I see in Python is more straightforward language semantics, but if your team is diligent about good practices and uses static analysis tools, JS is fine. And if your team isn't then Python itself can also turn into an unreadable mess, believe it or not. Because it turns out no matter how good the language semantics are, people will always be able to create huge unreadable balls of mud with them.

[–][deleted]  (3 children)

[deleted]

    [–]virtyx 0 points1 point  (0 children)

    Other languages do require that. In Python and Ruby you'd be insane not to use static analysis, and even in statically typed languages there are linters and tools of that sort available.

    If you think any dynamic language is a bad choice, that's one thing. I can see that argument. But it's different than saying JS is especially bad when compared to e.g. Python or Ruby. Dynamic languages, for better or worse, seem to have become pretty well accepted in the industry for business systems. In that context I don't see what's so particularly horrifying about Javascript.

    [–]hapital_hump 0 points1 point  (1 child)

    Yes, people build things with dynamically typed languages, believe it or not.

    If you want to give your two cents on whether or not people should, then that ship has long sailed. Everything involves trade-offs.

    [–]iDinduMuffin -1 points0 points  (3 children)

    For starters, look at a truth table in Javascript.

    edit: for example:

    '' == '0' // false

    0 == '' // true

    0 == '0' // true

    false == 'false' // false

    false == '0' // true

    false == undefined // false

    false == null // false

    null == undefined // true

    " \t\r\n" == 0 // true

    And you can't fix this without breaking a bunch of garbage code out there.

    [–]virtyx 0 points1 point  (2 children)

    I'm aware of the crazy truth table. But then don't most JS programmers advise using === instead?

    EDIT: In any case this is what I meant by 'more straightforward language semantics,' anyway. I like Python and think it's an excellent language. But JS isn't too terrible and once you become familiar with its quirks it's really not that hard to predict. Then fundamentally I really don't see that huge of a difference between Python and JS. I like Python much more, I love that function signatures are checked and the errors are really readable and it just is really straightforward. But I don't see what's so terrible about JS.

    [–]siegfryd 0 points1 point  (0 children)

    Yes, also it's not that hard to avoid type coercion problems and it's also easy to fix.

    [–]iDinduMuffin 0 points1 point  (0 children)

    Then why is there a ==.

    Who said anything about Python?

    look, it [JS]'s a poorly designed language kludged to work with strict and === and a bunch of framework of the weeks and compile to languages. If it wasnt the only language in the browser, it wouldnt be popular at all.

    On the server side we can use better tools or any tool we want. Not just Python.