halubilo.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to Programmer [email protected] • 2 years ago

Pure Evil

lemmy.world

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

Pure Evil

lemmy.world

@[email protected] to Programmer [email protected] • 2 years ago
message-square
14
fedilink
  • cross-posted to:
  • [email protected]
  • @[email protected]
    link
    fedilink
    17•2 years ago

    Yes.

    Besides, Javascript doesn’t need semicolon since 2016.

    • @[email protected]
      link
      fedilink
      31•
      edit-2
      2 years ago

      • @[email protected]
        link
        fedilink
        7•2 years ago

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

        Awesome!

        • @[email protected]
          link
          fedilink
          4•2 years ago

          Glad you take it like a champ :)

    • @[email protected]
      link
      fedilink
      English
      19•
      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”.

      • @[email protected]
        link
        fedilink
        English
        6•2 years ago

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

      • @[email protected]
        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.

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

      [This comment has been deleted by an automated system]

Programmer [email protected]

[email protected]

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.
  • 362 users / day
  • 1.78K users / week
  • 2.36K users / month
  • 9.97K users / 6 months
  • 35.7K subscribers
  • 1.72K Posts
  • 37.3K Comments
  • Modlog
  • mods:
  • @[email protected]
  • @[email protected]
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org