Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root797346yIt simplifies includes/requires:
`require Bar from "components/Foo/Bar"`
`require Qux from "components/Qux"
This allows you to have assets/subcomponents organized nicely without having to specify "Qux.js" every time.
"index" is a little odd, but it is already widely understood and accepted as standard practice. What would you suggest instead? -
@Root is right, It works like (and probably comes from) the index.html used for decades. But I don't see any situation where this is mandatory, everytime I saw it, it was configurable.
In components I often use index.js, but for the application level entry point I stick to app.js or even main.js. -
v00d01826y@Krokoklemme js this days is not only web it's anywhere, so it has no sense having index as convention. Based on your thoughts even python, elixir, go etc. should have it. In my opinion Is not convention is just a fact... and we accepted it as good only because the creator of node decided so.
I fucking hate that in JavaScript we have the naming convention of index.js for entry points, whyyy? no sense, thanks node
rant
nodejs
javascript