4 ms·
Word of warning from hard experience: rn is a really dangerous thing to name a function because it is one char away from rm.
by tgbugs 5y ago
Word of warning from hard experience: rn is a really dangerous thing to name a function because it is one char away from rm.
- eyelidlessness 5y agoNote to self: snag “notTerseAtAllMoreVerboseIdentifiersForGreatGood.js” on NPM
- TheSkyHasEyes 5y agoren would be better than rn. :)
- itsbenweeks 5y agoAgree. Having this function exit if any arguments are passed to it seems like a good safety measure.
- spurgu 5y agoOne char away also physically on the keyboard (maybe that's what you meant?).
- Extigy 5y agoI once ran “crontab -r” instead of “crontab -e” and also thought that was terrible design for the same reason.
- tgbugs 5y agoYeah, the physical layout is the primary concern. I should have noted that since there is ambiguity because n and m also happen to be next to each other in the alphabet.
- post-it 5y agoLooks like it's typically run without any arguments, so it's probably fine.
- lioeters 5y agoA typo can go the other way, like "rn somefile" where it was meant to remove a file but instead it renames all files.