4 ms·
I actually don't see why the whole index.js thing is nice. What happened to prefering explicitness? All it does is save a couple of characters, it doesn't make
by BigJono 8y ago
I actually don't see why the whole index.js thing is nice. What happened to prefering explicitness? All it does is save a couple of characters, it doesn't make anything clearer. It's just one more noob trap that's neither here nor there for experienced devs.
- BillinghamJ 8y agoOne nice benefit was that you could change from a module being defined as a single file to making it a folder with the logic split across multiple files without any other files needing to be changed
- BigJono 8y agoMehhhh, to quote Joel Spolsky: "This is the kind of thing you solve in 5 minutes with a macro in emacs".
- pvorb 8y agoYes. You end up with a million index.js files in your project and finding the right one is a PITA.
- BillinghamJ 8y ago...? That's what directories are for.