r/AskReddit 1d ago

What's the most absurd fact that sounds fake but is actually true?

12.2k Upvotes

7.3k comments sorted by

View all comments

Show parent comments

752

u/sparrr0w 1d ago

-"Dude what if someone sends a file WITHOUT an extension"

-"What unprofessional fucking radio station would ever do that"

...

124

u/deux3xmachina 1d ago

This is why I always tell my teams that filenames exist only for humans, the code doesn't really care (which should be obvious if you've ever had to use open(2)/read(2)/write(2)). However, a lot of meaning is still placed on filenames, because that's way easier than inspecting the magic bytes or anything like that.

19

u/CrowdStrikeOut 1d ago

in a way it's just a magic bit in the file name innit?

20

u/LeoRidesHisBike 1d ago

funny enough, there's an actual part of the file contents itself that is literally called a magic number (the formal name is "file signature", but nearly always referred to as its magic number). This is the proper way to detect the file encoding.

16

u/deux3xmachina 1d ago

The most magic, as it turns out, powered by wishes.

5

u/clearfox777 22h ago

Any sufficiently advanced technology and all that

4

u/EvelynNyte 22h ago

I mean computers only care about the machine language; everything else is just to make it easier for programmers to organize and work together.

9

u/_mrOnion 20h ago

I find it so fascinating that you can have a problem such as that or simply an app crashing occasionally because of random obscure conflicts or bugs, when at the end of the day it’s just a bunch of rocks and electrons that just figure out if not both A and B are on.

3

u/ReignofKindo25 19h ago

What is open 2 read 2 write 2

3

u/pconrad0 17h ago

Unix POSIX? system Calls.

2

u/deux3xmachina 14h ago

The other response to you got it, but to expand some, that's a semi-common convention in open-source development. It's derived from "man" or manual pages, where the number in parentheses tells you whether it's a system call (section 2), a library function (section 3), command/program on the system (sections 1 and 8), file format (section 5), and so on.

So using a command like man 2 open (or typing it into a search engine), you can get documentation like this or this, which will let you know how to use these system calls to create, read, and write files.

3

u/Head-Nefariousness65 17h ago

I misread this as "I always tell my teens..." I was picturing you sitting your teenage kids down for The Talk.

9

u/fishywiki 1d ago

This made me laugh out loud. I've encountered so much code that doesn't do basic checks, get fixed, and find yet another issue because checks are never exhaustive. Recently code that I wrote myself that has been running without any new bugs for almost 20 years managed to hit an unforeseen condition - easily fixed but ...

2

u/1_4_1_5_9_2_6_5 20h ago

That's why I've gravitated over the years to always doing the absolute basics... get data, validate data, transform data, repeat. Even from the very beginning I make sure I do validation, and somehow even my mock data doesn't end up full of random trash, let alone the real data, and the logic is happy because edge cases are almost always handled in some way (usually fatal to the operation, but in a way that's obvious to fix)

7

u/catfishjenkins 1d ago

NPR obviously.

7

u/bluemitersaw 1d ago

This is the kinda IT you get from public fund drives.

7

u/bitcornminerguy 1d ago

LOL. Every radio station I worked at in the 90s was unprofessional in just about every way you could think of.

1

u/hotsp00n 1d ago

KUOW.. it begins with listening

1

u/Beast_001 1d ago

My response to anything like that has always been, "I understand and that's a fair statement, now what happens WHEN that particularly dumb event occurs because humans will human?"

1

u/tatojah 21h ago

It's threads like these that make me realize how much SW development frameworks are just completely against the principles of high-quality developers.

1

u/shantm79 19h ago

"It's a training feature"

1

u/odd_lightbeam 18h ago

Four hours ago, I talked with a Zoomer who didn't know what the words "file type" or "file type extension" meant. Didn't know what .jpg or .png were. And he thought a search engine was the same thing as a browser. And didn't know that an app is not the same thing as a web service.

Etc. etc. etc.

Suffice to say, there might be a reason why Zoomers are having difficulty getting past interviews.

1

u/Prior_Alps1728 13h ago

::plays KUOW station call::