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

wh... what extension do you use now then


When I first started doing web dev, everyone was using ".htm". But I haven't seen that used since the 20th century.


I always regarded .htm as a sign the site was created using FrontPage. Elsewhere .html was common even back then.


I learned the basics of HTML in the early 2000s from a book, it used .htm so that's also what I used for a long time.


I 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.


Isn'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.


> 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.


I 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"


.htm is another option, but AFAIK it went out of fashion a long time ago.


I edited my post, my bad :(




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

Search: