literature.cafe
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
realitista@lemmy.world to Programmer Humor@programming.dev · 2 years ago

Pure Evil

lemmy.world

message-square
56
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
438

Pure Evil

lemmy.world

realitista@lemmy.world to Programmer Humor@programming.dev · 2 years ago
message-square
56
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • darcy@sh.itjust.works
    link
    fedilink
    arrow-up
    116
    arrow-down
    1
    ·
    2 years ago

    any modern compiler or ide will notice this and warn you.

    • massive_bereavement@kbin.social
      link
      fedilink
      arrow-up
      35
      ·
      2 years ago

      Same, I thought this is gotta be a problem for someone who uses notepad as their main editor.

    • Jumuta@sh.itjust.works
      link
      fedilink
      arrow-up
      12
      arrow-down
      3
      ·
      2 years ago

      meanwhile vim:

      • Amaltheamannen@lemmy.ml
        link
        fedilink
        arrow-up
        15
        ·
        2 years ago

        If you are coding on vim you use a language server 😝

      • darcy@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        vim is not an ide i believe. but an lsp will notice

    • watcher@nopeeking.link
      link
      fedilink
      arrow-up
      5
      ·
      2 years ago

      Yeah, it will tell you that it existed a semicolon… 😁

      • luciferofastora@lemmy.zip
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        …for which my default fix would be to delete and reenter it in hopes of fixing ehatever hiccup the syntax validator is having

  • BradleyUffner@lemmy.world
    link
    fedilink
    English
    arrow-up
    54
    arrow-down
    1
    ·
    2 years ago

    Any remotely capable IDE will immediately show you what, and where, the problem is.

    • stebo@sopuli.xyz
      link
      fedilink
      arrow-up
      12
      ·
      2 years ago

      it would still be confusing why all semicolons are highlighted

      • qaz@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        VSCode has a special case for this

    • etler@programming.dev
      link
      fedilink
      arrow-up
      5
      arrow-down
      2
      ·
      2 years ago

      That means that detection was added explicitly because this prank was done enough that it was worth it to add.

      • dylanTheDeveloper@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        We do a little trolling

      • Quik@infosec.pub
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        The reason is in fact not only because of this exact symbol, but because people tried to change program’s behavior in a malicious way by replacing legitimate code with same looking symbols.

  • NegativeLookBehind@kbin.social
    link
    fedilink
    arrow-up
    31
    arrow-down
    1
    ·
    2 years ago

    Something similar happened to me a while back. I was copying some code from a Mac to a remote Linux host. For some reason the Mac was using a thing called an “en dash” – which is slightly longer than a regular hyphen - and was really fucking frustrating to figure out.

    • pthaloblue@sh.itjust.works
      link
      fedilink
      arrow-up
      54
      arrow-down
      1
      ·
      2 years ago

      I don’t know why I’m here commenting about this, but I love type, so:

      Hyphen (-): the short one, used for hyphenated words. fire-eaters. Close-up.

      en-dash (–): slightly longer, traditionally the length of a lowercase"n" in the typeface. Used between for things like a timeframe. 10–11:30, August–October

      em-dash (—): the longest of the three, and the length of a lowercase “m”. Used as a punctuation mark to denote a side comment or to abruptly cut off a sentence. “It’s a great punctuation mark—in fact I overuse it—but it’s still useful.” “Hey where are you going with that giant—”

      I didn’t bother to double check the definitions, so there might be more specific rules, but these are my rules of thumb.

      • Spiralvortexisalie@lemmy.worldBanned
        link
        fedilink
        arrow-up
        7
        ·
        2 years ago

        Dictionary source for possible particulars: https://www.merriam-webster.com/grammar/em-dash-en-dash-how-to-use

        • pthaloblue@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          2 years ago

          Ah this is nice!

      • Chemical@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2 years ago

        Thank you. I have learned something new today!

    • AlexWIWA@lemmy.ml
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 years ago

      Ah, my favorite character. I abuse the hell out of the em-dash.

      • psud@aussie.zone
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        For someone who abuses it, there is a remarkable absence of em-dashes in your comment :—)

    • lobut@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      Some mac apps have some quirks, the default note app was probably not meant for pasting code in, but when you do it changes the quotes and makes them all fancy. Drives me up the wall and there’s nobody to blame but me.

      • NegativeLookBehind@kbin.social
        link
        fedilink
        arrow-up
        7
        ·
        2 years ago

        I blame Steve Jobs.

        • IndescribablySad@threads.net@sh.itjust.works
          link
          fedilink
          arrow-up
          6
          ·
          2 years ago

          Let’s dig him up and put him on trial. If it’s good enough for the pope, it’s good enough for him.

      • 🐍🩶🐢@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 years ago

        I was looking for this. Some text from webpages end up pasting that way too, even on non-mac systems, and it is utterly infuriating. Nothing I hate more than having to paste something into notepad++ so I can fix all the stupid quotes from some online tutorial that is giving you things to paste into a command prompt.

  • SokathHisEyesOpen@lemmy.ml
    link
    fedilink
    English
    arrow-up
    16
    arrow-down
    1
    ·
    2 years ago

    I knew a guy who used the Unicode character for a space in his password. He figured if anyone ever saw his password they’d think it was a space and still not be able to use it. It’s silly, but it was a fun thing to learn about him.

    • bc001@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      Which character. Does it need Combination of keys or a Single key.

      • SokathHisEyesOpen@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        A combination of keys. I don’t remember the code anymore.

        • quinkin@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          2 years ago

          Alt-255 was the old-school method.

          • Cow_says_moo@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 years ago

            I use alt 0160 for a non-line breaking space.

          • Carl@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            I can’t type alt codes with my keyboard.

    • shastaxc@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      That’s pretty neat, but also means he will never be able to log into things on mobile

      • elint@programming.dev
        link
        fedilink
        arrow-up
        4
        ·
        2 years ago

        Bitwarden has no problem filling passwords containing unicode characters on Andorid.

  • Python@programming.dev
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    2 years ago

    ESLint has entered the room

  • coffee_poops@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 years ago

    semicolons are optional in js anyway…

    • mrpants@midwest.social
      link
      fedilink
      English
      arrow-up
      8
      ·
      2 years ago

      Most of the time. Sometimes it can lead to code that is ambiguous and ASI picks the wrong way to interpret it.

      https://stackoverflow.com/questions/25088708/what-rules-must-i-follow-to-write-valid-javascript-without-semicolons

      • coffee_poops@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 years ago

        Right, but there’s not going to be a syntax error.

  • Drew Belloc@programming.dev
    link
    fedilink
    arrow-up
    8
    ·
    2 years ago

    If the language doesn’t force me to use semicolons i will forget

  • itsraining@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    2 years ago

    Technically I don’t think any Greek layout uses a different Unicode codepoint for the question mark. In fact, the ordinary semicolon symbol is used, so what the meme describes would probably not happen IRL.

    Does all this make it any less funnier? No. It’s still brilliant.

    • luciferofastora@lemmy.zip
      link
      fedilink
      arrow-up
      12
      ·
      2 years ago

      In Unicode, it is separately encoded as U+037E ; GREEK QUESTION MARK, but the similarity is so great that the code point is normalised to U+003B ; SEMICOLON, making the marks identical in practice.

      Source: https://en.wikipedia.org/wiki/Question_mark

      I’m still curious whether it would be accepted by the code interpreters / compilers of various languages. I’m not bold enough to assume they all normalise properly.

      • itsraining@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        2 years ago

        Wow, thank you, didn’t know of that.

    • nxfsi@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      2 years ago

      Unicode should have enforced the principle of using the same encoding for similar looking characters like they did with CJK instead of allowing bullshit like the Cyrillic “o” or the Greek question mark.

      • yum13241@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        1,000% percent.

  • Boxman@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    2 years ago

    Me who programs in rust which has a specific compiler message to tell me what happened

    • Hawk@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 years ago

      Cargo fix

  • friend_of_satan@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 years ago

    deleted by creator

  • tfw_no_toiletpaper@feddit.de
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    2 years ago

    I don’t even know what to say to this one.

  • newIdentity@sh.itjust.works
    link
    fedilink
    arrow-up
    8
    arrow-down
    9
    ·
    2 years ago

    Who uses semicolons in Javascript?

    • seitanic@lemmy.sdf.org
      link
      fedilink
      arrow-up
      32
      ·
      2 years ago

      Programmers who care about best practices. Here are a couple of scenarios where not using a semicolon will bite you in the ass.

      • newIdentity@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        arrow-down
        11
        ·
        edit-2
        2 years ago

        deleted by creator

        • seitanic@lemmy.sdf.org
          link
          fedilink
          arrow-up
          10
          ·
          2 years 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?!?”

          • tryagain@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            I don’t even bother typing them because I like having eslint do it for me.

        • rockSlayer@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          2 years 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.

    • tkarika@lemmy.world
      link
      fedilink
      arrow-up
      26
      arrow-down
      1
      ·
      2 years ago

      Every real programmers

      • psud@aussie.zone
        link
        fedilink
        arrow-up
        2
        ·
        2 years 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@lemmy.sdf.org
      link
      fedilink
      arrow-up
      6
      ·
      2 years ago

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

    • Perfide@reddthat.com
      link
      fedilink
      arrow-up
      5
      ·
      2 years ago

      People who like minimizing the amount of bug fixing.

    • manapropos@lemmy.basedcount.com
      link
      fedilink
      arrow-up
      3
      ·
      2 years 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

      • newIdentity@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        That’s what I do too, but i don’t manually add them

Programmer Humor@programming.dev

programmer_humor@programming.dev

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: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

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

  • 1.37K users / day
  • 4.7K users / week
  • 9.03K users / month
  • 17.2K users / 6 months
  • 12 local subscribers
  • 23.1K subscribers
  • 1.37K Posts
  • 46.9K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org