The Enchanted Tavern
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@realitista@lemmy.world to Programmer Humor@lemmy.ml • 2 years ago

Pure Evil

lemmy.world

message-square
14
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
122

Pure Evil

lemmy.world

@realitista@lemmy.world to Programmer Humor@lemmy.ml • 2 years ago
message-square
14
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
alert-triangle
You must log in or register to comment.
  • doomkernel
    link
    fedilink
    42•2 years ago

    Wouldn’t the IDE pointed it out?

    • @MyNameIsRichard@lemmy.ml
      link
      fedilink
      1•2 years ago

      Obviously, you patch the IDE so it doesn’t

    • Awkwardparticle
      link
      fedilink
      7•2 years ago

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

    • @joneskind@lemmy.world
      link
      fedilink
      17•
      edit-2
      10 months ago

      deleted by creator

      • Skull giver
        link
        fedilink
        3•
        edit-2
        1 year ago

        [This comment has been deleted by an automated system]

      • @angel@iusearchlinux.fyi
        link
        fedilink
        English
        18•
        edit-2
        2 years ago

        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”.

        • @flying_sheep@lemmy.ml
          link
          fedilink
          2•2 years ago

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

          There is no problem anymore.

        • @kinttach@lemm.ee
          link
          fedilink
          English
          6•2 years ago

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

      • @Downcount@lemmy.world
        link
        fedilink
        32•
        edit-2
        2 years ago

        • @joneskind@lemmy.world
          link
          fedilink
          7•
          edit-2
          10 months ago

          deleted by creator

          • @Downcount@lemmy.world
            link
            fedilink
            4•2 years ago

            Glad you take it like a champ :)

  • Dandroid
    link
    fedilink
    22•2 years ago

    The IDE will tell you and fix it for you.

    • @admin@sh.itjust.works
      link
      fedilink
      5•2 years ago

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

  • @c3zth@lemm.ee
    link
    fedilink
    5•2 years ago

    Jokes on them I don’t use semicolons in JavaScript

Programmer Humor@lemmy.ml

!programmerhumor@lemmy.ml
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: !programmerhumor@lemmy.ml

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.
  • 7 users / day
  • 38 users / week
  • 149 users / month
  • 1.65K users / 6 months
  • 1 subscriber
  • 1.58K Posts
  • 29.6K Comments
  • Modlog
  • mods:
  • @AgreeableLandscape@lemmy.ml
  • @cat_programmer@lemmy.ml
  • UI: unknown version
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org