this post was submitted on 22 Sep 2025
983 points (98.7% liked)

Programmer Humor

26673 readers
1605 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] Korne127@lemmy.world 2 points 6 days ago

Can't relate. I use shell all the time, and I always use spaces in file paths, especially to make sure scripts I make still work then

[–] lemming741@lemmy.world 193 points 1 week ago (3 children)

Microsoft intentionally made programs install to C:\Program Files on Windows 95+ to force programmers to deal with spaces in filenames.

Someone make one of those "statements made by the utterly deranged" memes about it, please and thank you.

[–] lime@feddit.nu 77 points 1 week ago (10 children)

what is even more funny about this is that the name of that directory used to be locale-dependent, so in sweden it was just called "Program", completely nullifying that idea.

[–] jjagaimo@sh.itjust.works 58 points 1 week ago (2 children)

C:\Program Files

C:\Program Files (x86)

C:\ProgramData

[–] some_kind_of_guy@lemmy.world 51 points 1 week ago

C:\PROGRA~1

[–] BanMe@lemmy.world 42 points 1 week ago

The fucking parenthetical x86 absolutely kills me. I don't normally wish dick cancer on people,

load more comments (9 replies)
[–] sexy_peach@feddit.org 32 points 1 week ago

No this is just clever

load more comments (1 replies)
[–] IcedRaktajino@startrek.website 113 points 1 week ago (16 children)

I've recently learned that in Linux, you can use emois in filenames. I died a ~~little~~ lot inside when I learned that.

[–] FrostyPolicy@suppo.fi 79 points 1 week ago* (last edited 1 week ago) (5 children)

On Linux file systems you can use any character except NULL, and / is a reserved character.

E.g. on ext-4 "All characters and character sequences permitted, except for NULL ('\0'), '/', and the special file names "." and ".." which are reserved for indicating (respectively) current and parent directories."

[–] xthexder@l.sw0.com 56 points 1 week ago (8 children)

I once accidentally created a file with a newline character in it... it was pretty tricky to fix from command line.

[–] malware@lemmy.zip 85 points 1 week ago (3 children)
[–] tdawg@lemmy.world 66 points 1 week ago

Arrest this person

[–] voodooattack@lemmy.world 31 points 1 week ago (1 children)
[–] malware@lemmy.zip 24 points 1 week ago (1 children)

it was on accident, habibi, I swear 😁. I messed up some cmake code for preprocessing .txt ascii sprites into constants and accidentally created this abomination

[–] voodooattack@lemmy.world 10 points 1 week ago (1 children)

I once made a script to delete .o, .lib, and .so files from my huge dev folder to free up space on my home partition.

It did not go as planned.

load more comments (1 replies)
[–] exu@feditown.com 15 points 1 week ago

This is why you shouldn't parsels output btw. Use find and read instead

[–] GenderNeutralBro@lemmy.sdf.org 13 points 1 week ago

I actually did this a lot on classic Mac OS. Intentionally.

The reason was that you could put a carriage return as the first character of a file, and it would sort above everything else by name while otherwise being invisible. You just had to copy the carriage return from a text editor and then paste it into the rename field in the Finder.

Since OS X / macOS can still read classic Mac HFS+ volumes, you can indeed still have carriage returns in file names on modern Macs. I don't think you can create them on modern macOS, though. At least not in the Finder or with common Terminal commands.

load more comments (6 replies)
load more comments (4 replies)
[–] Gyroplast@pawb.social 23 points 1 week ago (4 children)

In filenames? AMATEURS! Use obscure Unicode in your passphrases for maximum security. Ctrl-Shift-U, enter arbitrary code point, bam! 🦊 Works even better with a Compose key and a nice, chonky .XCompose file to throw some gr∑∑k letters around, for instance, like some confused script kiddie. :)

On topic: There are multiple variants of spaces in Unicode. You're welcome, and now go and create something utterly deranged with that information.

[–] luciferofastora@feddit.org 1 points 4 days ago

Some grSSk letters?

load more comments (3 replies)
[–] nialv7@lemmy.world 18 points 1 week ago (1 children)

unix filenames are just string of bytes, the operating system does not interpret it in anyway. this is a much saner approach compared to Windows where language settings can change file system behavior.

load more comments (1 replies)
[–] bobs_monkey@lemmy.zip 15 points 1 week ago

I'm just gonna pretend I didn't hear that.

[–] Benign@fedia.io 13 points 1 week ago

⏰️.🪵

[–] maxwells_daemon@lemmy.world 9 points 1 week ago

ChatGPT is taking notes

load more comments (9 replies)
[–] SpaceScotsman@startrek.website 59 points 1 week ago (5 children)

I\ don\'t\ know\ what\ you\ mean,\ I\'ve\ never\ encountered\ any\ annoyances.

load more comments (5 replies)
[–] asdfranger@lemmynsfw.com 42 points 1 week ago* (last edited 1 week ago) (2 children)
Oh\ come\ on,\ it\'s\ not\ that\ bad

Some shells enclose those types of files within inverted commas. Such that:

> ls
file\ name.md

is instead

> ls
'file name.md'

(I use fish)

[–] Supreme@reddthat.com 25 points 1 week ago (4 children)

"inverted commas"? single quotes?

[–] asdfranger@lemmynsfw.com 15 points 1 week ago (2 children)

Yes, I am a weird english.

load more comments (2 replies)
load more comments (3 replies)
load more comments (1 replies)
[–] bleistift2@sopuli.xyz 33 points 1 week ago (1 children)

Are you typing the whole filename by hand? Tab expansion exists, you know?

[–] Truscape@lemmy.blahaj.zone 15 points 1 week ago* (last edited 1 week ago) (1 children)

If it fucking works...

Sometimes it does. But not always.

[–] kernelle@lemmy.dbzer0.com 13 points 1 week ago

Zsh changed my life, but I still hate escape chars in my command lines for readability reasons

[–] livingcoder@programming.dev 24 points 1 week ago (3 children)

Now I use lowercase and underscores everywhere.

[–] drmoose@lemmy.world 9 points 1 week ago (3 children)

Hyphens > underscores for filenames because all web standards prefer hyphens so if you ever want to network your files its a much smoother experience!

load more comments (3 replies)
load more comments (2 replies)
[–] cupcakezealot@piefed.blahaj.zone 21 points 1 week ago (1 children)

the struggle between spaces in filenames look cute and oh fuck what's the code to reference a space in a filename in terminal?

[–] kamen@lemmy.world 9 points 1 week ago (4 children)

Just put the whole thing in quotes. You might have to escape extra sets of quotes, usually with a backslash.

load more comments (4 replies)
[–] callyral@pawb.social 20 points 1 week ago (3 children)

not sure why the default behavior is this:

file\ name\ with\ a\ bunch\ of\ spaces

instead of this:

"file name with a bunch of spaces"

but you can just press " before pressing tab to auto-complete, and it will use the 2nd form

[–] lord_ryvan@ttrpg.network 1 points 20 hours ago* (last edited 20 hours ago)

I mean, at least in Bash tools like ls do use quotes by default:

$ ls
 filename_without_space  'filename with space'

But yeah, tab expansion uses backslashes, sadly.

load more comments (2 replies)
[–] AmazingAwesomator@lemmy.world 17 points 1 week ago* (last edited 1 week ago) (5 children)

i think i am old. i grew up using DOS, and really hated spaces in filenames and folders because they appreared truncated at the first space with a tilde and index of that file/folder representation.

ex: C:\folder name is bad\ == C:\folder~1

i hated that so much that when i got to windows 3.1 i refrained from using spaces (some command line was still necessary in w3.1)

i have jept that habit through the years, so when i moved from windoes to linux, my natural instincts of snake_case_folder_names made it so i didnt have to change : D

[–] aaaaaaaaargh@feddit.org 11 points 1 week ago

That's not even DOS I think. As far as I know Win 95 came up with this monstrosity in an attempt to circumvent the 8.3 character limitations present in older versions of DOS.

load more comments (4 replies)
[–] lengau@midwest.social 17 points 1 week ago

I very intentionally have all my code in Personal Projects 🥰 and Work Projects 🏦 directories so I can find bugs in the handling of file paths.

[–] BombOmOm@lemmy.world 14 points 1 week ago (1 children)

I'm a big fan of PascalCase. ThisIsAGreatFilename.odt

load more comments (1 replies)
[–] SnotFlickerman@lemmy.blahaj.zone 14 points 1 week ago (1 children)
[–] floquant@lemmy.dbzer0.com 11 points 1 week ago

Yep, exactly. And tab. \ is weird at first but makes sense if you think about it

[–] Lyra_Lycan@lemmy.blahaj.zone 11 points 1 week ago* (last edited 1 week ago)

Windows is stupid as shit, trying to shift+right click > open Powershell in a path containing a space results in it throwing an error, and you have to paste the path in yourself anyway

[–] ronigami@lemmy.world 11 points 1 week ago (1 children)

If your code is written well, it shouldn’t matter.

[–] Sonotsugipaa@lemmy.dbzer0.com 19 points 1 week ago (6 children)

They're annoying to deal with when interactively using command-line shells, especially so when pasting unquoted and unescaped file paths, doubly especially so with Bash where parameter expansion makes no goddamn sense if you know at least one other programming language

load more comments (6 replies)
[–] bob_lemon@feddit.org 10 points 1 week ago* (last edited 1 week ago)

My work has me working with Matlab Simulink paths, which may (and sometimes actually do) contain newlines.

load more comments
view more: next ›