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

I wish I could say the same, but nearly half of the teams I've worked with on web development go exclusively with .js because it's been pushed by prominent members of the React community for "ergonomics"[0] (which here is just a fancy way of saying devs can't be bothered to invest the two seconds it takes to make file extensions accurate when switching to a superset language) The trend of unreliable file extensions has lots of other nasty side effects on IDEs, build tools, and browsers (e.g. [1])

[0] https://github.com/airbnb/javascript/pull/985#issuecomment-2...

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=659515



I worked in Facebook briefly, and the reason why Dan (who also is/was at Facebook) might be suggesting this is because this is the practice at Facebook: all "JS" files use the same build system and file extension. Which is to say, there's no JS, or TS, or even CommonJS APIs. It's all and always Facebook-flavored Flow (with the occasional caveat).

And perhaps this is why it didn't seem obvious for Dan (I'm speculating) that anyone would want to use multiple file extensions for things, but when you're outside of Facebook's ecosystem and you have to set up your own build tools and deal with all the pain it comes with, you realize stuff like this makes no sense. Because ya know, maybe targeting by file extension in your build system would make it easier to use the right transpiler (e.g. that's what Parcel does). But that's just been my perspective being in both worlds.




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

Search: