Hacker News new | ask | show | jobs
by netsharc 24 days ago
Isn't it just great how a decision made by some genius in Microsoft decades ago caused so much confusion and mess. Even on Windows 11 the default is to hide extensions, because, geez, wouldn't want to confuse people with change after decades of it being like that.

Although, was the hiding something that the Mac introduced?

The idea of the last part of the filename (after the period) determining what program is launched to handle the file is odd anyway...

I wonder if the Windows spyware infrastructure measures what % of people turn off extension hiding..

3 comments

> The idea of the last part of the filename (after the period) determining what program is launched to handle the file is odd anyway...

I challenge you to suggest a better solution - the best that Linux came up with is a giant database of all magic numbers known to God and praying that something matches... sometimes it does, and sometimes it even matches the correct program.

the linux way works tho
it really doesn't

hiding information from user is not good by any means

But relying on them to tell the OS what type a file is, or allowing them to change the extension, isn't good either. lena.jpg doesn't become lena.pdf by changing the last 3 letters of the filename..
It gets really complicated when you get into overlapping file types, like with ISOBMFF. An .mp4 can also, simultaneously, be a valid .3gp because those are profiles of ISOBMFF. On the other extreme, JPEG is secretly two different incompatible formats (JFIF and Exif), and a video file with a different codec in the same container, or even a different track layout, might as well be a different format.
> allowing them to change the extension, isn't good either

why not?

power to the people. At worst it just breaks. At best you get filetype chamelions that are straight up cool, yet harmless

Am I missing something? Hiding things from users is a property of the windows approach. Did you reply to the wrong person?
GGP comment literally says that linux way is hiding file type in the binary information. If you consider that as more visible I have many questions

windows at least gets an option to display file type

Some file formats, eg png, require a particular file header in order to be considered valid. This is true regardless of your operating system, be it windows or linux. If that is hidden information, then it is hidden regardless of which operating system you're on. On windows, if I have a png named .doc, then there is absolutely no way to determine that it is a valid png and could be opened with my image viewer with standard tools. On linux it will recommend you open the file with an image viewer regardless of the file extension. That seems to me like significantly less hidden information.
The mac started out without using extensions at all, the type was embedded in the metadata. That's still possible now, but it's largely derived from extensions first. I believe Finder shows all extensions by default. It certainly does in details mode.
Macs originally didn’t have filename extensions because the file type was stored as metadata in the file system
That really is a superior way of doing things too. Or at least it would have been if that metadata were transferred with the file itself in all protocols.