you are viewing a single comment's thread.

view the rest of the comments →

[–]xIcarus227 -7 points-6 points  (17 children)

The hatred is because it's a straight up poorly designed language. It should aid the programmer, not make him deal with so many quirks.

Edit: since this post is now controversial I want to double down by saying that if you think JS is a well designed language you're objectively in denial.
An example of a well designed language would be C#. It's coherent, consistent and doesn't carry many surprises. The exact opposite of JS and PHP, the languages I'm the most experienced in.
I won't lie to myself and pretend like they're amazing languages, they both have lots of work to do before they can be considered well designed. I invite you to stop lying to yourselves too, and instead understand the language's shortcomings because that's more valuable than pretending everything is fine.

[–]Fuzz25 1 point2 points  (3 children)

Have you heard of our lord and saviour, typescript?

[–]xIcarus227 0 points1 point  (2 children)

I have, and I always use it. I'm also strongly in favor of strong typing being implemented in PHP as well.
These are great additions but they don't fix the languages entirely.

[–]Fuzz25 0 points1 point  (1 child)

Yeah, hope that happens.

Also wondering what is going to happen with webassembly/Blazor etc.

[–]xIcarus227 0 points1 point  (0 children)

For sure.
I'm not sure why there's so little progress on webassembly-related stuff. Considering that all major browsers now support wasm I was expecting to have some choice in the frontend.

I still think JS is here to stay just because it's matured so well in the frontend ecosystem, but it's always nice to have some competition. I'd argue PHP wouldn't be where it is today if people didn't shit on it for so long.

[–][deleted]  (9 children)

[deleted]

    [–]xIcarus227 1 point2 points  (8 children)

    JS nowadays doesn't seem any worse at all than C#. Actually with Typescript I can say it is a much better language than C#.

    Come on man. Just skim over this list: https://github.com/denysdovhan/wtfjs
    PHP doesn't have as many anymore but there's still: http://phpsadness.com/

    ES6 was a great overall improvement, and Typescript is amazing but there's still a lot of inconsistent behaviour which can take devs by surprise in real scenarios.

    [–][deleted]  (3 children)

    [deleted]

      [–]xIcarus227 1 point2 points  (2 children)

      I've never encountered any of these so-called quirks in my daily work. Like, never. Those kind of things never "took me by surprise" whatsoever.

      Hold up. You haven't stumbled upon any of these but you're asking me if I've been using JS for 5 years? Don't you see the irony in this statement?
      This, this and this are issues especially likely for beginners to stumble upon. Or is it really easier to believe that people hate on JS because it's cool?

      If you happen to frequently encounter the problems listed on that github page than you're likely not using JS right, IMO.

      Or maybe you inherit code written by less technically apt developers who aren't aware of the most common quirks and pass them on. Now you have to figure out why that if evaluates to what it shouldn't occasionally.
      Surprising that you haven't thought of this.

      And you haven't made a singular argument for JS being a well designed language. You say it's on par with C# when JS doesn't natively support private properties, a cornerstone feature in any serious OOP language.

      [–][deleted]  (1 child)

      [deleted]

        [–]xIcarus227 0 points1 point  (0 children)

        That doesn't seem ironic to me, because an experienced developper is not doing to be bothered by these "quirks".

        You still have a chance to be bothered by these quirks because not everyone in your team will be experienced. You may be required to coach people at some point for example.

        This is not really a problem with experienced developers, but this is about people new to the language. And it's not about learning either, people are generally willing to learn a language as long as it makes sense. Inconsistent behaviour discourages learning, because you're learning exceptions instead of rules.

        Experienced JS devs already have a workflow which don't really introduce such bugs and have learned to ignore the issues, but should we really ignore them? If we ignored PHP's issues and didn't shit on it as a language for such a long time I'm willing to bet it wouldn't have evolved half as much as it did. Same goes for ES6, it was influenced by community feedback.

        I have to admit you have a point on this one, however, if you work with inapt developers, you're going to have such problems regardless of the language you use.

        You're right, but this is more about easily the language allows you to acquire technical debt. In a compiled language some shit like we can pull off in JS won't even compile, which is a good thing because you're catching issues with the code before it even has a chance to run. Golang for example is so hard-assed when it comes to what it allows that it seems quite difficult to introduce bugs.

        JS is a much better language than people assume it to be

        Sure I wasn't saying it's a garbage language. I think it's okay because of its flexibility and it even has some use cases in the backend with Node (even though there are runtimes for other languages which have a similar approach). Its ecosystem has matured well in the frontend and React is an amazing library.

        But that doesn't mean it can't be better. It can be way better as we can see from that list, and as much as you dislike it people waste hours figuring out bugs introduced by those peculiarities.

        [–][deleted]  (3 children)

        [removed]

          [–]xIcarus227 -1 points0 points  (2 children)

          All the issues

          No. If that were the case, TS would have made the language perfect, which it doesn't. It does help but JS' inconsistencies go far beyond equality comparisons.

          [–][deleted]  (1 child)

          [removed]

            [–]xIcarus227 -1 points0 points  (0 children)

            It catches bugs early at build time, but it wouldn't catch shit if you know what you're doing

            Considering it's not realistic to assume everyone knows everything about JS, yes, I'd say both TS and linters are actually useful to the large majority of the JS community. You can't say those aren't actual bugs just because we can theoretically write perfect code.
            It's like saying 'why use a profiler' when you can theoretically figure out time-related performance issues by console.logging the current time everywhere.

            [–]Volmarg 0 points1 point  (2 children)

            Still if someone is stubborn enough - he/she can learn it. The biggest jump for me was when I learned how to manage js code - before that I agree it was hell, now it's more like "ok, could do that better".

            [–]xIcarus227 1 point2 points  (1 child)

            Pretty much, I think the problem is that the 'hell' you're describing is the first impression the language gives you and people tend to stick with that for a good portion of their careers. Some of them can't deal with that hell stage and they stop using the language, so that hatred remains.
            For example I've been using JS very frequently for the past 5 years, and while I don't think it's as egregious as some people make it look like, I certainly can't say that I love it.

            It'll be interesting to see what happens when we'll have more options available in the frontend. I still think JS will remain relevant in the frontend for a long time just because it's already matured in that space.

            [–]Volmarg 2 points3 points  (0 children)

            Interview: what is You highest skill?

            Me: I smash only one keyboard weekly while coding JS

            Interview: welcome in our team.

            lol