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