Slashdot Mirror


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.

9 of 246 comments (clear)

  1. Simple by Anonymous Coward · · Score: 5, Insightful

    git revert [commit]

    "Your commit broke the build. Fix it."

    Bonus points if your continuous integration build server catches it automatically.

    Then have a talk with the author of this non-sense commit about wasting corporate resources.

    1. Re:Simple by Rei · · Score: 4, Interesting

      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."
    2. Re:Simple by Opportunist · · Score: 5, Insightful

      Besides, anyone here who can honestly say he never did the "magic" thing, i.e. delete a line and retype it only to have it suddenly work for no good reason whatsoever?

      I dare say that most programmers would simply delete the offending line and retype it once everything that does actually make sense has been tried.

      Black magic. Do it. I get the candles, Fred brings the voodoo doll, you can start chanting.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    3. Re:Simple by Anonymous Coward · · Score: 4, Informative

      This happens a lot with Russian programmers due to Latin C and Cyrillic Es homoglyphs that happen to be on the same key, and it's very easy to forget which keyboard layout is currently selected and type the wrong letter.

  2. Maybe before source code control by Mr.+Sketch · · Score: 4, Insightful

    Wouldn't they see your change to the file in the history/blame for the line?

    Or do they suggest you hack your co-workers machine to run this script on their system?

  3. One thing that always drove me crazy... by BitterOak · · Score: 4, Interesting

    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?
  4. Re:funny. by 93+Escort+Wagon · · Score: 4, Insightful

    It's probably funny to people who don't have to earn a living. I expect I'd have considered it hilarious back in high school... but now, if a colleague did this, I'd probably demand he be fired.

    --
    #DeleteChrome
  5. Re:Nice try ... by JoeyRox · · Score: 4, Insightful

    That's a good strategy because anyone working with Perl has probably already pulled all their hair out.

  6. Re:Never undstood this crap by Alsee · · Score: 4, Funny

    Han Unification:
    Han shot at the same time.

    -

    --
    - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.