The Lemmy Club
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
realitista@lemmy.world to Programmer Humor@lemmy.ml · 2 年前

Pure Evil

lemmy.world

message-square
14
link
fedilink
  • cross-posted to:
  • [email protected]
122

Pure Evil

lemmy.world

realitista@lemmy.world to Programmer Humor@lemmy.ml · 2 年前
message-square
14
link
fedilink
  • cross-posted to:
  • [email protected]
alert-triangle
You must log in or # to comment.
  • doomkernel@sopuli.xyz
    link
    fedilink
    arrow-up
    42
    ·
    2 年前

    Wouldn’t the IDE pointed it out?

    • joneskind@lemmy.world
      link
      fedilink
      arrow-up
      17
      ·
      2 年前

      Yes.

      Besides, Javascript doesn’t need semicolon since 2016.

      • Downcount@lemmy.world
        link
        fedilink
        arrow-up
        33
        arrow-down
        1
        ·
        edit-2
        2 年前

        • joneskind@lemmy.world
          link
          fedilink
          arrow-up
          7
          ·
          2 年前

          Wait, did you just made a meme of my comment?

          Awesome!

          • Downcount@lemmy.world
            link
            fedilink
            arrow-up
            4
            ·
            2 年前

            Glad you take it like a champ :)

      • angel@iusearchlinux.fyi
        link
        fedilink
        English
        arrow-up
        19
        arrow-down
        1
        ·
        edit-2
        2 年前

        Automatic Semicolon Insertion (ASI) has (sadly) been a part of JavaScript longer than 2016. I’m not sure exactly when it was introduced, but this document from 2009 already contains it: https://web.archive.org/web/20120418215856/https://ecma262-5.com/ELS5_Section_7.htm#Section_7.9

        IMO it’s bad practice to rely on ASI since the semicolons may not get inserted where you expected them to. The following snippet

        const x = 0
        const y = x
        [1, 2, 3].forEach(console.log) 
        

        is interpreted as

        const x = 0;
        const y = x[1, 2, 3].forEach(console.log);
        

        which raises a TypeError.

        There are more examples of ASI not doing the right thing on the web, so I don’t agree with “Javascript doesn’t need semicolon”.

        • kinttach@lemm.ee
          link
          fedilink
          English
          arrow-up
          6
          ·
          2 年前

          As Mark Twain said, “Never discuss politics, semicolons, tabs, or religion in polite company.”

        • flying_sheep@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          2 年前

          Use an autoformatter for all code (both in the editor on save/type and as CI check).

          There is no problem anymore.

      • Skull giver@popplesburger.hilciferous.nl
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        2 年前

        [This comment has been deleted by an automated system]

    • Awkwardparticle@artemis.camp
      link
      fedilink
      arrow-up
      7
      ·
      2 年前

      Only someone who is really into mental torture would not use a linter.

    • MyNameIsRichard@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      2 年前

      Obviously, you patch the IDE so it doesn’t

  • Dandroid@dandroid.app
    link
    fedilink
    arrow-up
    22
    ·
    2 年前

    The IDE will tell you and fix it for you.

    • admin@sh.itjust.works
      link
      fedilink
      arrow-up
      5
      ·
      2 年前

      Not if they use GNU nano or that shitty windows notepad.

  • c3zth@lemm.ee
    link
    fedilink
    arrow-up
    5
    ·
    2 年前

    Jokes on them I don’t use semicolons in JavaScript

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 49 users / day
  • 989 users / week
  • 3.15K users / month
  • 9.85K users / 6 months
  • 31 local subscribers
  • 37K subscribers
  • 1.79K Posts
  • 38.7K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.12
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org