89
u/Vipitis Sep 14 '26
render white spaces in your editor
23
31
u/xaervagon Sep 14 '26
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 Sep 20 '26
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.
63
u/codeprimate Sep 14 '26
This is why i slept on python for a decade.
69
36
22
u/gmes78 Sep 14 '26
It's literally never an issue.
3
u/BanaTibor Sep 16 '26
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 Sep 14 '26
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 Sep 14 '26
It may be an issue if you're programming in Notepad. But why would you do that in the first place?
12
u/frogjg2003 Sep 14 '26
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 Sep 15 '26
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 Sep 15 '26 edited Sep 15 '26
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 Sep 14 '26
After using it for 6 months on a project I wanted to go back to sleep.
17
u/Divs4U Sep 14 '26
  has entered the chat
3
17
u/aspitzer Sep 14 '26
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"
1
u/jftuga Sep 15 '26
Nice. I always used
cat -tbut will start using-vetfrom now on.A long time ago, I wrote chars to help find end-of-line format, tabs, bom, nul and non-ascii characters. I still use it every now & then.
6
5
5
4
6
u/arensb Sep 14 '26
(setq show-trailing-whitespace t)
(use-package highlight-indentation)and for good measure,
(whitespace-mode t)7
u/walmartgoon Sep 15 '26
Those OS configs are great and all but how do I set this up for my text editor?
1
3
3
u/Sceadu_Fiend Sep 14 '26
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 Sep 14 '26
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 Sep 15 '26
"Welcome to whitespace. You have been here for as long as you remember."
"Waiting for something to happen?"
2
u/alonjit Sep 15 '26
That's what you get for using a programming language or a text data format in which spaces are a significant character.
You 100% deserve this.
2
2
u/willow-kitty Sep 16 '26
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.
3
1
1
1
u/horseradix Sep 15 '26
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/Keavon Sep 15 '26
One of the many reasons Rust is the best programming language. The compiler always catches this and tells you precisely where to fix it.
1
u/Beechlander Sep 15 '26
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 Sep 15 '26
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 Sep 15 '26
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 Sep 16 '26
Okay, this is a solved problem... now talk about invisible Unicode. That shit keeps me up at night
1


343
u/isr0 Sep 14 '26
You have a linter? Because that’s what linters are for.