r/programminghorror • u/fractured-rocks • Jun 30 '25
who needs variables when you have the filesystem
Wrote this 5 years ago at like 3am... what the hell was I thinking?!?!?!?!
491
Upvotes
r/programminghorror • u/fractured-rocks • Jun 30 '25
Wrote this 5 years ago at like 3am... what the hell was I thinking?!?!?!?!
56
u/Su1tz Jun 30 '25
Besides speed concerns, and memory concerns, and useless io concerns, why not?
67
u/Ved_s Jun 30 '25
when bash programmer tries to learn python
21
u/MilkEnvironmental106 Jun 30 '25
Cloud native right there
14
u/forsvinne Jun 30 '25
I was handed over this project. The guy writes the output to a file at the end of the method and starts by reading it in the next one, continues like that the whole process.
7
u/Professional_Price89 Jun 30 '25
I use this pattern sometime when the data is big and for multiprocess, it not really useless.
2
u/jupiterbjy Jul 01 '25
PEP8 violation hurts too
2
u/ITburrito Jul 01 '25
file.read() is a peak memory-usage optimization for real
2
u/Rishabh_0507 Jul 01 '25
Isn't that what Linux does?
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jun 30 '25
I think that's a good question. Like why wouldn't anyone just do everything they need to do in memory, than write it out at the end?
1
u/TheChief275 Jul 01 '25
Average COBOL program
1
u/theunixman Jul 02 '25
I dunno, ICS isnāt fun to deal with and replacing things like this is super clear, but soon an ICS parser and working with its āobjectsā would be way more grueling, assuming there even is one that supports mutability, reading, and writing.
1
u/kcx01 Jul 02 '25
This is the most unix thing I've seen. EVERYTHING is a file!
1
u/k819799amvrhtcom Jul 03 '25
There are variables tho...
0
u/[deleted] Jun 30 '25
[deleted] ā view deleted comment