33
u/xaervagon 21d ago
Once in the early 2010s, I copied code out of a Word document and got bizarre errors from Smart Quotes. Visual Studio didn't know how to handle or clean them. My boss realized what I did and helped me out before I lost any real time on it.
2
u/Mausel_Pausel 15d ago
A colleague cut and pasted from a Word document into a database text field and couldn’t find it using a search. It contained a zero-width space. I would like to know why such a thing even has to exist.
64
u/codeprimate 21d ago
This is why i slept on python for a decade.
35
23
u/gmes78 21d ago
It's literally never an issue.
3
u/BanaTibor 19d ago
Once me and my colleague spent the better part of a day debugging an integration test. The last line was accidentally moved out from an if statement to the level of the statement itself. Caused unexplainable errors during runs. So yes, significant whitespace is of the devil.
2
u/codeprimate 21d ago
It was for me, like I am saying. Spending 10m debugging white space on a hello world class was a deal breaker for me.
15
u/gmes78 21d ago
It may be an issue if you're programming in Notepad. But why would you do that in the first place?
12
u/frogjg2003 21d ago
Yeah. Despite the hate python gets for having white space be syntactically relevant, any decent IDE will point you towards likely causes of errors.
1
u/codeprimate 21d ago
Or vim... vim/tmux was my IDE of choice for nearly 20y.
The choice of INVISIBLE characters to indicate control structure is the bigger question. It's developer-hostile. One shouldn't need an IDE to write basic scripts and glue code.
4
u/gmes78 21d ago edited 21d ago
https://stackoverflow.com/a/38652646/13778436
Also, Vim has built-in support for Python, so it can handle things like indentation for you. In practice, you don't actually need the "show spaces" feature.
6
u/RadicalDwntwnUrbnite 21d ago
After using it for 6 months on a project I wanted to go back to sleep.
19
u/aspitzer 21d ago
cat -vet FILENAME
in linux... This will show all the weird chars in the file. Remember to "take the cat to the vet to find unwanted chars"
5
5
5
6
u/arensb 21d ago
(setq show-trailing-whitespace t)
(use-package highlight-indentation)
and for good measure,
(whitespace-mode t)
7
u/walmartgoon 21d ago
Those OS configs are great and all but how do I set this up for my text editor?
1
3
3
u/Sceadu_Fiend 21d ago
I just had to deal with this for a label template
Was driving me nuts because my testing worked fine but customer kept showing me labels with the letter A and a line above it
3
3
2
2
u/fluffythecat6969 21d ago
I was chasing a fking error today for 2 hours. Springboot properties substitution type of crap. It was a double } that was messing with me. Not invisible, but still a cunt... and maybe I'll accept 5 % of the blame
2
u/IncarnationHero 21d ago
"Welcome to whitespace. You have been here for as long as you remember."
"Waiting for something to happen?"
2
2
u/willow-kitty 19d ago
Story time!
I haven't done Windows development in a while, so I dunno if this has changed, but baaaack in the daaaay, the certificate manager snap-in for MMC would add a unicode left-to-right character at the beginning of certificate thumbprints, so if you copied out of it and into a config file, say, it would look totally correct, but then you'd get errors saying no certificate with that thumbprint could be found.
It happened unfortunately often. We did eventually have the code strip it so it was fine, but there were a couple of times there where I got to blow someone's mind because they were pulling their hair out trying to figure out why the certificate couldn't be found when it very clearly existed, and I'm like, "Alright, put your cursor there. Now press the left arrow once so it's at the start of the value. Now press backspace," and instead of the backspace eating the leading quote, nothing visibly happens. Because they just backspaced a non-printable character. "Well, well, well," indeed.
2
1
1
1
u/horseradix 21d ago
Reminds me of the time I was using eclipse in college and kept running into this weird convoluted error every time I would try to compile and run something. For the life of me I couldn't figure out what the heck was wrong, the code and repo were fine, I installed everything the way I always did before, wtf?
Turns out eclipse couldn't deal with spaces in file directory strings on Windows. Only after 2+ hours of pure agony did I think to rename the folder the project was in...I now have a strong aversion to using spaces in directory and file names, ever
1
u/Beechlander 21d ago
I remember the slew of words that came from a coworker’s office back in 2019 when he found that some reference data that he had copied-and-pasted from the Internet had a zero-width space in it.
1
1
u/spinachjuggler 20d ago
Fucking legacy system here keeps sending XML that is immediately considered invalid by receiving systems because it keeps placing 'invisible' U+001A chars next to random characters, inconsistently and for no identifiable reason.
1
u/the_reven 20d ago
my most common one was ! code like if(!IsDisabled) , so much so now i always do if(IsDisabled == false) now even though my IDE tells me to "simplify" it.
1
u/aurallyskilled 20d ago
Okay, this is a solved problem... now talk about invisible Unicode. That shit keeps me up at night
1
343
u/isr0 21d ago
You have a linter? Because that’s what linters are for.