4 ms·
#4 seems spurious. Just another example of "If everyone did it my way, then everyone would be doing it my way." What if people don't want to do it your way? Wha
by acbabis 11y ago
#4 seems spurious. Just another example of "If everyone did it my way, then everyone would be doing it my way." What if people don't want to do it your way? What if people can actually remember to spell correctly?
EDIT: *nix has case-sensitivity so that people can actually use it.
- hunterloftis 11y agoIt isn't about spelling. It's about behavior that will be presumed correct in one environment but not in another. It's about portability. For another node example - in Linux, you can successfully use paths like `let filepath='foobar/' + filename`. That's correct in the given environment. However, such code will break when run in Windows. This is why `let filepath = path.join('foobar', filename)` is a superior solution. A Windows or OSX user can save Myfile.js all day long and require('MyFile') with success. That same code will break as soon as you try to run it in Linux. These recommendations are the product of supporting the many thousands of Node apps built each week on Heroku.
- acbabis 11y agoThanks for the reply. While I understand the argument about preventing pitfalls, it's reasonable to expect programmers to pay attention to capitalization, since source code requires you to anyway. I think the path of least resistance here, is to tell programmers to spell things the same way as the last person to work on the code spelled it.
- AgentME 11y agoWindows supports regular / symbols in pathnames. What system doesn't?