When even Michael Jackson can’t decide on path separators across OSes
Description
The meme shows two stacked stills of a famous dancer in a white suit performing his gravity-defying lean: the top frame leans left and is annotated on the right with a single forward-slash “/”, the bottom frame leans right and is annotated with a backslash “\”. Beneath both images, bold black text reads: “After all these years, I still don’t know which should I use when writing a path”. The visual gag mirrors the constant pivot developers make between Unix-style “/” and Windows-style “\” path delimiters, a nuance that rears its head in shell scripts, build pipelines, and cross-platform tooling. The meme resonates with seasoned engineers who have resorted to path.join utilities, double-escaping in JSON, or outright cursing when a CI job fails because the slash leaned the wrong way
Comments
46Comment deleted
Some teams refactor monoliths; the rest of us are still refactoring ‘/’ into ‘\\’ just to make the same build pass on Windows - talk about technical debt with 50-year amortization
After 20 years of writing cross-platform build scripts, I've mastered every design pattern except one: the Observer pattern that watches me type 'C:/Users\Documents/project\src' and silently judges my inconsistent path separators
The path separator debate is the developer equivalent of the tabs vs spaces war, except it's actually enforced by the OS kernel. You can write `os.path.join()` or `pathlib.Path()` all you want, but deep down you know there's a raw string literal with a hardcoded separator lurking somewhere in your codebase, waiting to break on the first Windows CI runner. The real smooth criminal move? Using forward slashes everywhere and letting Windows silently accept them in most APIs while your Linux colleagues remain blissfully unaware of the chaos you've avoided
Senior take: the only correct separator is whatever path.join/Path.Combine/std::filesystem returns - hand‑typing slashes is a cross‑platform regression in waiting
By 20+ years in, the only slash I choose is whatever path.join returns - every other choice becomes a Friday postmortem titled: “C:\ wasn’t /.”
MJ mastered the lean; Windows mastered '/' support in '95. Unix devs still can't escape the drama
forward slash. it's cross platform and you don't need to put two of them. Comment deleted
+ Comment deleted
which one is forward slash? Comment deleted
the opposite of the backwards slash Comment deleted
forward slash is the one that's easier to type on the keyboard Comment deleted
/ Comment deleted
Windows is the only back-slash domain, IIRC Comment deleted
DOS? Comment deleted
Yes, too Comment deleted
OS/2 CP/M Also there's locale fun such as ¥ But nowadays I'm not aware of many systems that try to not have at least some semblance of POSIX compat that are not RTOSes Comment deleted
Backslash for windows Forward slash anywhere alse Comment deleted
Lmao, true. I always forget Comment deleted
/ если linux \ если windows Comment deleted
Translation: use / on linux use \ on windows Please use English in this chat and do not violate the rules Comment deleted
Sorry Comment deleted
what if you wanted to program something cross-platform…? Answer: don't bother, every sensible library uses / Comment deleted
you can make two versions, one with / and the other with \. #define SLASH "/" and then #define SLASH "\" Comment deleted
or use std::filesystem Comment deleted
/ works on windows too, you don't need to do that Comment deleted
you have fucked up second define, you chould have written #define SLASH "\\" because backslash has to be escapee Comment deleted
understood. I'm just on Linux Comment deleted
it doesnt matter when you print \n you get a newline how to print backslash? double backslash. Comment deleted
Ok Comment deleted
perfect Comment deleted
I would add automatic disk format and Linux installation to this code. 🙃 Comment deleted
i have both at the same key Comment deleted
huh? Comment deleted
On my kbd it's shift+6 for forward and altGr+(+) for backwards Comment deleted
bruh Comment deleted
\ | / Comment deleted
on my laptop keyboard it is the same Comment deleted
seems to be the standard for English keyboards then Comment deleted
Someone needs to build a time machine and "convince" cp/m developer to not use / for command options. Comment deleted
Windows: \ unix: / Comment deleted
Windows: \ insane: / Comment deleted
and to use for escape sequences? Comment deleted
/ Comment deleted
I choose violence today Comment deleted
but powershell uses ` Comment deleted
path\to\directory even looks atrocious and unnatural to me Comment deleted