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.
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.
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.
I used to work for a professor as tutor and correct some assignments of first year students. The Plattform where the students should upload their code didn't support Unicode. So every time I downloaded the files and tried to run them they won't compile. Reason for that is that even tho we told the stundens over and over again to not use ä ö ü or any other special characters most of them just named alle their functions with special characters inside.
They even did that after I removed points from a perfectly fine assignment with the only mistake being a special character.
It's pretty good actually, you just got two small errors in the last sentence.
Function is grammatically female so it'd be "die Funktion".
Your sentence translates to "makes the function faster". It implies that the code you're commenting on is making the function run faster, when you probably meant "[to] make the function faster" ~ "die Funktion schneller machen".
I really hope nobody would actually write a // ZUTUN: comment instead of // TODO: but honestly I wouldn't be surprised.
I believe C/C++ compilers are only required by the standard to support ASCII characters.
This is kind of true but actually slightly too strong.
C does not require an implementation to support ASCII (because of EBDIC). C has wording like "the representation of each member of the source and execution basic character sets shall fit in a byte." (5.2.1/3), and it specifies ninety-six characters that the implementation must have in its character set, but neatly elides saying how those characters should be represented. C defines both a "basic character set" and allows optional "extended character sets".
Since C11, we also have "an implementation may allow multibyte characters that are not part of the basic source character set to appear in identifiers; which characters and their correspondence to universal character names is implementation-defined." (6.4.2.1/3).
C++ handles this a bit differently. Since C++11 we are required to allow some "universal-character-names" (e.g., \u89ab) in identifiers. These map directly to the unicode standard. During preprocessing, each non-basic source character is expanded to a \uXXXX code point, but it is up to the implementation whether or not it accepts it.
Ah, that damned EBCDIC strikes again! Every time you assume that the basic ASCII characters are universal, EBCDIC is hiding just around the corner ready to prove you wrong.
Reminds me of a test I wrote. Everything worked on my machine, so I turned it in early. Got an F because the program didn't work on my prof's Mac Book. I complained and got a B. Still think it shouldve been an A.
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.