8 ms·
Why is Java apparently one of the few languages that are brave enough to use four characters in its file extension? “Rust” becomes “rs”.
by avgcorrection 3y ago
Why is Java apparently one of the few languages that are brave enough to use four characters in its file extension? “Rust” becomes “rs”.
- tbm57 3y agofewer letters saves valuable developer time typical java, prioritizing verbosity at the expense of efficiency /s
- dmoy 3y ago> /s Not entirely sarcastic though, looking at e.g. DescriptiveFooThingFactoryFactory
- avgcorrection 3y agoConsidering that Java needs a four-letter acronym (POJO) to describe value classes... I think a fancy acronym for fully spelled-out file extensions is in order. The Spelt Out File Extension Pattern?
- duxup 3y agoI used to write all my html files with .htm… apparently that went out of fashion. Edit: I got my htm and html backwards and now comment not sense. Fixed now but obviously the folks below were right / responding to an earlier version.
- veidr 3y agowh... what extension do you use now then
- deleted 3y ago[deleted]
- watermelon0 3y ago.htm is another option, but AFAIK it went out of fashion a long time ago.
- ForkMeOnTinder 3y agoWhen I first started doing web dev, everyone was using ".htm". But I haven't seen that used since the 20th century.
- Karellen 3y agoI prefer not using an extension. That way if I change my site infrastructure from, e.g. static html, to php, to mediawiki, to cgi-bin, to asp, to ruby on rails, all my URLs can stay the same (because cool URLs don't change) throughout, without containing misleading legacy baggage.
- joemi 3y agoIsn't this something you can just configure at the server level, so you don't need to have your files be extensionless? I could swear I've done that before in apache.
- Karellen 3y ago> Isn't this something you can just configure at the server level Oh, yeah. I mean, you have to configure the server to treat extensionless files as html/cgi/php/whatever anyway, so you could just have it load extensionless URLs from .html/.cgi/.php files, but I prefer to keep my server config as "surprise-free" as possible. If `/article/foo` is served from the file `$DOCUMENT_ROOT/article/foo` on the filesystem, I find that less confusing for everyone than if it's served from `$DOCUMENT_ROOT/article/foo.php`. It's a matter of personal preference, for sure. Just like `.htm` over `.html`. (Or `.jpg` over `.jpeg` for that matter.) I wouldn't say the way I do it is "right", but it's a trade-off that works for me.
- vallode 3y agoI guess I'll add to the pile of thoughts by saying that I think the parent comment was making a snide remark about .jsx/.tsx files, i.e "no one writes HTML anymore"
- duxup 3y agoI edited my post, my bad :(
- treyd 3y agoI personally use .htm for anything that's an incomplete chunk of an HTML-ish document, like a Jinja2 template file, and .html for full rendered documents.
- Aardwolf 3y agoPossibly the following? It wouldn't 'sound' enough like a file name extension if it was the full name '.rust' Where the inertia of the history of 3-letter extensions in DOS and the likes is what caused this convention, of course
- xnx 3y agoSome languages (e.g. Perl, Python) are old enough to have been concerned with the 3 character extension limit from MS-DOS: https://en.wikipedia.org/wiki/8.3_filename https://en.wikipedia.org/wiki/8.3_filename
- throwaway167 3y agoAs a RapidSketch user on my organisations web ratings board working group living in a coastal area affected by soil erosion and with a penchant for DNA modelling, I find Rusts choice of file extension perturbing. .rust.programming.language would make far more sense than pretending Rust will ever need to work in DOS.
- capableweb 3y ago> Rust DOS : Creating a DOS executable with Rust https://github.com/o8vm/rust_dos https://github.com/o8vm/rust_dos
- deleted 3y ago[deleted]
- liampulles 3y agoLikely it was not a brave decision - just a decision, with no reason to pivot.
- icedchai 3y agoProbably because the first release was in 1996, so Java never ran on a platform (like DOS) that needed only 3 characters. Originally it only ran on Solaris and Windows 95/NT.
- js2 3y agoThere's no abbreviation of Java that isn't weird. These all work well: perl -> pl python -> py rust -> rs ruby -> rb javascript > js But java? java -> ja? jv? jav? Clearly Sun should've gone with a different name for the language entirely, I dunno, maybe they could've named it after an oak tree instead: oak -> ok Hmm, maybe I could get used to "jv" after all.
- duped 3y ago".j"
- rewmie 3y ago".jay". Why not?
- adwn 3y agoWhy would "ruby -> rb" be okay but not "java -> jv"?
- kps 3y agoThat's up with the oak leaves, over everyone's head. Anyway, `.ja` is German for `.ok`.
- gsich 3y ago.ja would be german for .yes.
- pbhjpbhj 3y agoWhy not .jva ?
- infradig 3y agoProlog -> pl Then Perl tried to steal it.
- Izkata 3y agoThe logo has always been a cup of coffee (one of the meanings of the word "java"), so maybe either ".cof" or ".caf" (for "caffeine")
- the_mitsuhiko 3y agoPretty sure the answer is that developers are lazy and want to write fewer characters.
- hn92726819 3y agoIf you think .java is brave, wait until you hear about Mojo's extension: https://en.m.wikipedia.org/wiki/Mojo_(programming_language) https://en.m.wikipedia.org/wiki/Mojo_(programming_language) They allow the extension to be the fire emoji
- CSMastermind 3y agoHot take: we should include emojis as reserved words in programming languages.
- marssaxman 3y agoI once included U+2620 'SKULL AND CROSSBONES' as a synonym for 'poison' in a language I was working on.
- deleted 3y ago[deleted]
- lp0_on_fire 3y agoMaybe I'm just an old curmudgeon but things like "you can use emojis as variables" (or in this case "the extension can be an emoji") scream amateur hour and a lack of seriousness to me. There's zero benefit, IMO, other than "it's quirky". Which is a shame because the people who created Mojo are definitely not amateurs.
- nix0n 3y agoFull support for Unicode has a lot of benefit to people who don't speak English. But, when you're trying to show off your Unicode support to Californians, emojis get more reaction than umlauts.
- skeaker 3y agoWouldn't it be harder to implement and therefore indicative of higher effort, if anything?
- 3y ago
- cesarb 3y ago> four characters in its file extension You are not looking close enough. While Java source code has four characters in its file extension (.java), the output of its bytecode compiler has five characters in its file extension (.class).
- otteromkram 3y agoMarkdown is .md and .markdown. No one uses the latter, though.
- gardenhedge 3y agoAnother brave language is Dart. example.dart
- kibwen 3y agoI can answer the Rust question. In the ancient era, Rust source code was split into two types of files: .rc files and .rs files. The latter were "Rust source" files, and the former were "Rust crate" files. The crate files were essentially header files; they defined the public interface of the crate by explicitly listing items to be exported from the crate. Eventually explicit export lists were removed (and replaced with visibility modifiers on items themselves), and so there was no reason for .rc files to stick around, and nobody really ever objected to .rs as the now-universal extension for Rust files, since it's still a valid abbreviation.
- doubloon 3y ago"why use big word when small word do trick" - Kevin Malone
- avgcorrection 3y agoAlso Orwell.