Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to [email protected] • 1 year ago

Destroying friendship

file.coffee

message-square
49
fedilink
651

Destroying friendship

file.coffee

@[email protected] to [email protected] • 1 year ago
message-square
49
fedilink
alert-triangle
You must log in or register to comment.
  • Brickardo
    link
    fedilink
    71•1 year ago

    Why, of all possible languages, would you suggest this for Javascript where semicolons are not mandatory

    • @[email protected]OP
      link
      fedilink
      3•1 year ago

      Ask the author of this meme.

    • @[email protected]
      link
      fedilink
      English
      22•1 year ago

      Not only that, the interpreter will point directly to the line of code and possibly to the exact character that is the problem. Any programmer worth anything would find the issue or, worst case, retype the line of code and have the problem fixed rather quickly. “Illegal character” is a pretty easy error to diagnose.

      But…I still chuckled a little at the intent of the joke. I’m sure there are better pranks one could come up with, though.

    • @[email protected]
      link
      fedilink
      7•1 year ago

      rule 24

  • @[email protected]
    link
    fedilink
    Español
    53•1 year ago

    Even better would be to remap their keyboard’s semicolon key to that symbol

    • я не из калининграда
      link
      fedilink
      12•1 year ago

      you are a criminal.

    • @[email protected]
      link
      fedilink
      29•1 year ago

      Before I read this comment I believed the concept of hell was immoral.

      • @[email protected]
        link
        fedilink
        5•1 year ago

        We all have the one friend or coworker…

  • @[email protected]
    link
    fedilink
    English
    21•1 year ago

    U+037E

    • @[email protected]
      link
      fedilink
      2•1 year ago

      BOM U+FEFF is another fun one, most editors won’t show it but it can cause errors like when I found one in a SQL script that was combined from existing utf-8 files together with cat. You’ll see it in a hex editor or in notepad I think it just made the rest of the line italic.

  • Frozzie
    link
    fedilink
    9•1 year ago

    Hah. Try it on my version controlled project!

    • @[email protected]OP
      link
      fedilink
      5•
      edit-2
      1 year ago

      What? Remapping your keyboard? Well, there are worst jokes, I still remember that time when the first PCs appeared and you could try them in shopping centers. They quickly stopped doing this, because some went into the BIOS and disabled the keyboard or worse, the screen, Hail Satan. Good ol’ times 😏

      • Frozzie
        link
        fedilink
        2•1 year ago

        No I mean the code is on a git repository so you see unsaved changes

        • @[email protected]
          link
          fedilink
          3•1 year ago

          When your keyboard is remapped, you commit those changes yourself.

  • @[email protected]
    link
    fedilink
    1•1 year ago

    u/foundsatan

  • @[email protected]
    link
    fedilink
    1•1 year ago

    Would be cooler if u do it in C

  • @[email protected]
    link
    fedilink
    12•1 year ago

    Wanted to use this to prank a colleague but SQL server accepts that as well lol

  • @[email protected]
    link
    fedilink
    19•1 year ago

    MSVC supports unicode. In C or C++, you could try:

    #define ; ;

    Second one is the greek semicolon but the client I’m using may strip it out. I’m too lazy to try.

    • @[email protected]
      link
      fedilink
      1•1 year ago

      I’m not sure but I think the second one looks just a tiny bit different, so it should have worked.

    • PM_ME_VINTAGE_30S [he/him]
      link
      fedilink
      English
      3•1 year ago

      Running #define ; anything yields error: macro names must be identifiers for both C and C++ in an online compiler. So I don’t think the compiler will let you redefine the semicolon.

      • @[email protected]
        link
        fedilink
        3•1 year ago

        Haha. Thanks for checking. Given the C pre-processor, I’m sure there’s a way to maliciously bork it if someone sets their mind to it.

        • PM_ME_VINTAGE_30S [he/him]
          link
          fedilink
          English
          2•
          edit-2
          1 year ago

          Well I just tried #define int void in C and C++ before a “hello world” program. C++ catches it because main() has to be an int, but C doesn’t care. I think it is because C just treats main() as an int by default; older books on C don’t even include the “int” part of “int main()” because it’s not strictly necessary.

          #define int void replaces all ints with type void, which is typically used to write functions with no return value.

  • @[email protected]
    link
    fedilink
    4•1 year ago

    Replace all

  • @[email protected]
    link
    fedilink
    English
    94•1 year ago

    Wouldn’t most development programs tell them the syntax error on the line and column where you replaced the semicolon

    This wouldn’t work

    • @[email protected]
      link
      fedilink
      3•
      edit-2
      1 year ago

      Yeah, doing something similar with brackets would be much more effective since that usually doesn’t give a line number. Is there a unicode clone of )?

    • kamen
      link
      fedilink
      2•1 year ago

      Yup. It’s as if we’re assuming this friend is coding inside Notepad.

    • @[email protected]
      link
      fedilink
      English
      41•1 year ago

      Just tested in the console, it gives an illegal character error and gives you the line number.

    • @[email protected]
      link
      fedilink
      76•
      edit-2
      1 year ago

      VSCode will add a yellow box around the character and tell you it’s an uncommon glyph.

      https://code.visualstudio.com/updates/v1_63#_unicode-highlighting

      To note, this came about because it could be valid code and it’s a security risk from copy/pasting malicious code. See:

      https://certitude.consulting/blog/en/invisible-backdoor/

    • @[email protected]
      link
      fedilink
      English
      17•1 year ago

      It would work for someone just starting and not knowing good tooling yet. However, the compiler should also tell you where to look and give you the area to look at as well. It’ll be less clear than an IDE, though.

  • @[email protected]
    link
    fedilink
    5•
    edit-2
    1 year ago

    Imagine using a language that still uses semicolons.

    • @[email protected]OP
      link
      fedilink
      12•1 year ago

      I still use it in Spanish, English and also in German, but certainly not very often.

      https://www.merriam-webster.com/grammar/a-guide-to-using-semicolons

      • @[email protected]
        link
        fedilink
        3•1 year ago

        Klingon doesn’t have a semicolon, switch to that.

        • @[email protected]OP
          link
          fedilink
          3•1 year ago

          But they programm in Malbolge

    • asudox
      link
      fedilink
      2•1 year ago

      I use Rust

    • @[email protected]
      link
      fedilink
      3•1 year ago

      What about the Oxford semicolon in formal languages?

    • Sippy Cup
      link
      fedilink
      1•1 year ago

      deleted by creator

  • radiofreeval [any]
    link
    fedilink
    English
    1•
    edit-2
    10 months ago

    deleted by creator

  • idunnololz
    link
    fedilink
    1•1 year ago

    Hilt

  • @[email protected]
    link
    fedilink
    English
    29•1 year ago

    Meanwhile in VS Code: hey, I see this Unicode symbol that’s confused for this expected symbol, would you like to replace it?

  • @[email protected]
    link
    fedilink
    23•1 year ago

    Maybe if you’re “coding” in notepad

    • @[email protected]
      link
      fedilink
      5•1 year ago

      I had a friend who was a compsci minor who did almost the entirety of said minor on a really old chromebook. They did everything on a basic text editor. You would be surprised

    • @[email protected]
      link
      fedilink
      3•
      edit-2
      1 year ago

      deleted by creator

      • @[email protected]
        link
        fedilink
        16•1 year ago

        I mean, if they’re evaluating hand written code no sane teacher is going to go “Good God this isn’t a semi colon, it’s a Greek question mark!”

        • @[email protected]
          link
          fedilink
          3•1 year ago

          And what of the insane ones?

[email protected]

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

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.
  • 23 users / day
  • 332 users / week
  • 1.43K users / month
  • 5.53K users / 6 months
  • 3 subscribers
  • 13.2K Posts
  • 289K Comments
  • Modlog
  • mods:
  • ghost_laptop
  • @[email protected]
  • Cyclohexane
  • Arthur Besse
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org