• @seitanic
          link
          1010 months ago

          ~95% of the JS code you see on the Web has semicolons. Apparently, a lot of programmers think it’s worth that extra keystroke to avoid these types of bugs. I agree with them. The difficulty with programming isn’t “Arrgh, there are too many keystrokes, my hands are tired!” It’s “Arrgh, HTF did this bug get in here?!?”

        • @rockSlayer@lemmy.world
          link
          fedilink
          1
          edit-2
          10 months ago

          They made it a named function, but this is literally how you format anonymous functions in js, a key feature that usually gets called with stuff like an onclick or onload call in the html domain.

      • @psud@aussie.zone
        link
        fedilink
        210 months ago

        In that sentence, we use “programmer” singular, because “every” is singular, though referring to many

        All real programmers

        Every real programmer

        Each real programmer

        No real programmer

        It’s pretty arbitrary

    • @BearJCC
      link
      610 months ago

      Old habits die hard. Learned JS, CSS and C++ all the same year about a decade ago.

    • I use prettier which by default adds semicolons. Coming from predominately doing backend stuff (mostly in Java) I don’t really mind, especially when the formatter adds them for me