Mimic, the Evil Script That Will Drive Programmers To Insanity (github.com)
JustAnotherOldGuy writes: Mimic implements a devilishly sick idea floated on Twitter by Peter Ritchie: "Replace a semicolon (;) with a Greek question mark (;) in your friend's C# code and watch them pull their hair out over the syntax error." There are quite a few characters in the Unicode character set that look, to some extent or another, like others – homoglyphs. Mimic substitutes common ASCII characters for obscure homoglyphs. Caution: using this script may get you fired and/or beaten to a pulp.
One thing that always drove me crazy was the Unix "make" command because of the syntax of the Makefiles. The problem was, unlike just about every other language, Makefiles distinguish between TAB and SPACE characters, and they can look indistinguishable in printouts. I always avoided make for that reason and just wrote shell scripts to compile my code. I've also stayed away from Python because of its use of indentation to indicate the scope of control structures. Too easy to screw up by mixing tabs and spaces. In many fonts used in early terminals and printers, zeros were drawn with a slash through them so they wouldn't be confused with uppercase O's. Now with Unicode replacing ASCII as the encoding for source code in most languages, let the nightmares begin!
If I can be modded down for being a troll, can I be modded up for being an orc, or a balrog?
Time-delayed or rarely-occurring "evil" can often be better. There's a number of examples here, although some would be harder to sneak past code review than others. Unless your code review system is lax, or (best) if you have write access to the repository. But some of the aforementioned ideas (or variants thereof) would be just brilliantly evil, to the point that the code works fine when you leave, but say three months later it starts rarely breaking at random times and locations, and the "code plague" just gets more and more common with time.
One case where Mimic could sneak past the compiler (and code review) but still cause problems would be inside strings. For example, there's a number of characters that render like spaces but are actually multibyte unicode characters. Same with dashes, underscores, and many other characters. Using them would cause the length of the string to not be what the user thinks it is. And string operations could accidentally break up the unicode characters. Such errors could slip code review by and cause random inexplicable runtime errors for quite some time. And the nice thing about those kinds of errors are that you can chock them up to accidents. "Oh, I'm so sorry! I was just copying some code off the net, the character must have gotten mucked up..."
"Oh, goodness. Look at my wrist, I have to go." "But what about your clothes?" "I don't love these."
I understand perfectly that other languages have different symbols. But when those symbols are effectively identical to an existing symbol, JUST USE THAT SYMBOL. What idiot decided they had to make a different Unicode character for the greek questionmark, rather than simply using the semicolon? What, the dot above the comma in the greek questionmark is more squarish? Big deal
excitingthingstodo.blogspot.com
A few years ago I had a problem when I would use OS X TextEdit to edit code. Somehow, I never figured out how, it would occasionally insert a control-P character into the text. Of course it was invisible. Other than looking at the file in a hex editor, the only way that I could find it was to use the arrow keys and note when the cursor didn't move. Or the error message from trying to compile/assemble the code.
I haven't seen this in a long time, and I currently still use 10.6.8, so maybe it was a problem in 10.5 that got fixed in 10.6.
And I have had other times where I had to retype a visually good line of code more than once. Not to mention the times when the font and my less than perfect eyesight make commas and periods hard to tell apart.
#naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }