all 50 comments

sorted by: hot top controversial new old
[–] 94 points 2 years ago (5 children)

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

This wouldn't work

  • source
  • hideshow 5 child comments
  • [–] 16 points 2 years 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.

  • source
  • parent
  • [–] 72 points 2 years ago (3 children)

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

  • source
  • hideshow 3 child comments
  • [–] 22 points 2 years 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.

  • source
  • parent
  • load more comments (1 reply)
    [–] 54 points 2 years ago (3 children)

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

  • source
  • hideshow 3 child comments
  • [–] 31 points 2 years ago

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

  • source
  • [–] 24 points 2 years ago (4 children)

    Maybe if you're "coding" in notepad

  • source
  • hideshow 4 child comments
  • [+] 0 points 2 years ago* (2 children)
  • [–] 21 points 2 years ago (6 children)

    That's too evil. At my work people like to put a tape under someone's mouse and it can be pretty funny.

  • source
  • hideshow 6 child comments
  • [–] [S] 7 points 2 years ago* (last edited 2 years ago) (4 children)

    Some hairs under the lens, it gives some funny erratic moves of the pointer.

  • source
  • parent
  • hideshow 4 child comments
  • [+] 21 points 2 years ago* (last edited 2 years ago) (1 child)
  • [–] 2 points 2 years 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.

  • source
  • parent
  • [–] 21 points 2 years ago (4 children)

    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.

  • source
  • hideshow 4 child comments
  • [–] 3 points 2 years ago (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 2 years ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 2 years 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.

  • source
  • parent
  • [–] 12 points 2 years ago

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

  • source
  • [–] 9 points 2 years ago (3 children)

    Hah. Try it on my version controlled project!

  • source
  • hideshow 3 child comments
  • [–] [S] 5 points 2 years ago* (2 children)

    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 😏

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 2 years ago
    [–] 3 points 2 years ago

    Replace all

  • source
  • [–] 1 point 2 years ago
    [–] 1 point 2 years ago

    Rust doesn't let you do this. Crab stays winning.

  • source
  • [–] 1 point 2 years ago

    Would be cooler if u do it in C

  • source
  • [–] 1 point 2 years ago

    u/foundsatan

  • source