Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

(This point is also made lower down).

When you run a program, your concern should be what it is called. Not how it is written.

A language-specific filename extension puts an implementation detail in userspace. If you run a binary executable, you shouldn't care whether it's written in C, C++, Fortran, or any other language (though source files, being used only by developers and compilers, generally do have extensions).

Worse: if you decide for whatever reason to change the implementation language, you're either forced to track down and change all references to the program name, or to retain the (now incorrect) filename extension for backwards compatibility.

And, as noted, magic(5) or the shebang line should correctly identify the file type and language for syntax highlighting -- if not, your editor is broken. Replace it with a shell script, "editor.sh".

file(1) will tell you the types of files in a directory with far greater accuracy than filename extensions can.



That makes sense. I think of shell scripts as "things programmers execute", but that's obviously not always the case.


They're very often things other programs execute.

Cron jobs, other scripts, production jobs, etc.

So having to hunt down and rename everything ... is a PITA.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: