The web collapses whitespace so if the code is not in <pre> tags you are stuck. This is quite often a case where comment systems were not intended to share code.
You're right, of course, this does often happen. Seems to me, though, the issue isn't cutting and pasting something on the web - it's getting it losslessly onto the web in the first place. It's the responsibility of the person posting the snippet to ensure it shows up correctly, and if their chosen platform doesn't support that they should use a better one.
This probably reads pedantically, but I do think there's a distinction. By analogy, if someone tried to post APL on a site that didn't support Unicode, you wouldn't say the issue is it's "hard to cut and paste APL".
Yes I would. Requiring a character set outside of ASCII is what I'd call a high-risk design decision, that could easily become a misfeature of a language. Windows "smart quotes" are bad enough and that's not even a programming language. This is why people invented J as an alternative to APL.
Would you say it's "hard to copy and paste Unicode"?
Most systems support UTF-8, so most of the problems have been solved by now. There's still a lot of scope for malicious or very surprising unicode; invisible characters or modifiers, font problems, RTL/LTR, characters which have different code points but cannot necessarily be visually distinguished ("ı = 1" etc), good old Zalgo, and so on.
Re:Why People Should Learn Python
by ramblenode on Wednesday August 24, 2016 @09:37AM
(#12351879)
It's Python's fault for not retrofitting its syntax to satisfy a markup language invented years later?
No, but it is a problem that people encounter nevertheless.
> Whitespace is included when you copy something. What's the problem?
In addition to the points posted in a parallel thread, selecting and copying leading whitespace reliably is more difficult than just getting the printable characters. Also: it's not something that anyone has any cause to do outside of copying Python text.
Admittedly it is mildly annoying when someone decides to use some random number of spaces for indentation, and you have to fix it to make it match the rest of your code (my preferred editor, Geany, has a feature for this). We should all just use tabs. But "very hard"?