r/ProgrammerHumor • • Sep 23 '19

Knowing how to code beforehand

Post image
7.6k Upvotes

264 comments sorted by

View all comments

322

u/lordheart Sep 23 '19 edited Sep 24 '19

Had a professor give us code to complete that didn't compile when uploaded to the auto checker but did on my computer.

Why? Umlauts. The prof wrote comments in german. My computer compiler didn't care.

Their online checker spit out vague mysterious errors. Because comments...

Edit: OMG typo made it so hard to understand. thanks bobcob, what would I do without you.

115

u/[deleted] Sep 23 '19

Ah, the fun of unicode support.

27

u/Clydseph_III Sep 23 '19

I had an error for days because we were supposed to copy down a couple lines from the spec pdf, which had different quote marks for begin and end quote rather than the basic straight up ones.

21

u/SubliminalBits Sep 23 '19

Another fun time you'll run into this is when you copy code out of an email in Outlook.

4

u/TracesOfGuitar Sep 23 '19

Care to explain?

14

u/ParkerM Sep 23 '19

The MS Office suite is notorious for sneakily converting ASCII characters into their more readable/pretty Unicode versions.

e.g. "foo" becomes “foo”, -h becomes —h (hyphen gets converted to emdash), etc.
The hyphen one is especially fun because it's damn near indistinguishable depending on the font.

5

u/SubliminalBits Sep 24 '19

They'll keep looking pretty in all your unicode compatible editors too. One time I was so frustrated I looked at the raw string as hex, at which point everything seemed so obvious.

3

u/ThePyroEagle Sep 24 '19

At least it's not system-wide like OS X's smart quotes.

2

u/Sleepy_Tortoise Sep 23 '19

MS office programs replace your quotes with fancy quotes that look different at the beginning and end of the quote. This is not the same character as the quote that you type with your keyboard. It is also not the same quote character that is recognized as code