• darklamer@feddit.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    This is wonderfully bizarre, but informative, I had actually wondered what exactly the rules were.

  • 𝘋𝘪𝘳𝘬@lemmy.ml
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    1 day ago

    tl;dr

    If you ever need to start a line with parens or brackets, consider using a ; right before it, as so many have adopted. Although, there is rarely a case where this would become a necessity.

    • Azzu@leminal.space
      link
      fedilink
      English
      arrow-up
      25
      arrow-down
      4
      ·
      edit-2
      1 day ago

      Tl;dr: just put a semicolon at the end, and you never need to think, this is just not really worth it

      • Deestan@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        24
        ·
        1 day ago

        Shitting on people “thinking too much” is the most destructive attitude you can have in software development. That is how we build real skills. It doesn’t matter if your opinion is that the thing being used to exercise on is weird or useless.

        • graynk@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          28
          ·
          1 day ago

          No, talking about semicolons and tabs and spaces for the umpteenth time is not how we build real skills, and you shouldn’t waste your time “thinking” about it. You should run a linter that will format it for you and you should choose formatting rules that everyone working on the codebase in the future would be mostly OK with. Splitting hairs about when to insert a semicolon ain’t it.

          • Azzu@leminal.space
            link
            fedilink
            English
            arrow-up
            13
            arrow-down
            1
            ·
            1 day ago

            To expand on this: Ideally you would work in a language you didn’t have these inane rules about semicolons, like the article is obviously good and correct, but it’s just not something that anyone should have to think about, it doesn’t lead to better programs.

            • Serinus@lemmy.world
              link
              fedilink
              English
              arrow-up
              8
              arrow-down
              2
              ·
              1 day ago

              There’s a lot of room for criticism of JavaScript, but this ain’t it.

              Just use semicolons at the end of a statement and it’s simple. There are only inane rules about it if you’re trying to skip semicolons, and why the fuck should anyone bother with that?

              • Azzu@leminal.space
                link
                fedilink
                English
                arrow-up
                2
                ·
                22 hours ago

                The inane thing is being able to skip semicolons. Exactly, why should anyone bother with that. We wouldn’t have this conversation. So yes, this is valid criticism of JavaScript, it’s not a very important one at all, but still.

              • wholookshere@lemmy.blahaj.zone
                link
                fedilink
                English
                arrow-up
                2
                arrow-down
                1
                ·
                24 hours ago

                You say thats not valid criticism, but yet I can’t think of another language that has a debate over semicolons.

                Maybe that’s just me not be exposed in my career to more ones like that, and there are still petty squables in every language yes.

                But the fact you have to have the second paragraph, and defend it, is the problem your replying to. something so core to a language like line ending syntax, is figured out in all other laugauges. You don’t have to mentally be prepared to unfril that layer of syntax.

                rabbles in statically typed laguages

            • very_well_lost@lemmy.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              23 hours ago

              Ideally you would work in a language you didn’t have these inane rules about semicolons

              I wish I had the luxury of not working with JavaScript… but sadly it’s still the only game in town on the web.

              • Azzu@leminal.space
                link
                fedilink
                English
                arrow-up
                1
                ·
                edit-2
                22 hours ago

                There are languages that compile into JS or WebAssembly, might be worth to look at that. I like Clojurescript, but others are also good.

        • Azzu@leminal.space
          link
          fedilink
          English
          arrow-up
          11
          ·
          edit-2
          1 day ago

          If you desire to interpret my comment as “shitting on people”, that is your prerogative. However, that is not how I meant it.

          Thinking about things is great, and that opinion is actually contained in my comment, if you look closely: I want people to think, just not about things that aren’t really worth it.

          The article is great, thinking about this in general is great, you just don’t want your future to be spent making decisions about where to place semicolons, that is not a beneficial use of one’s time. Without that thinking about where to place semicolons, you’re free to think about more useful topics.