Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tgbugs
· 5y ago · 0 comments
Word of warning from hard experience: rn is a really dangerous thing to name a function because it is one char away from rm.
Comments
[–]
spurgu
5y ago
One char away also physically on the keyboard (maybe that's what you meant?).
[–]
tgbugs
OP
5y ago
Yeah, 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.
[–]
jatone
5y ago
laughs in dvorak
[–]
kataklasm
5y ago
cries in colemak
[–]
Extigy
5y ago
I once ran “crontab -r” instead of “crontab -e” and also thought that was terrible design for the same reason.
[–]
post-it
5y ago
Looks like it's typically run without any arguments, so it's probably fine.
[–]
lioeters
5y ago
A typo can go the other way, like "rn somefile" where it was meant to remove a file but instead it renames all files.
[–]
itsbenweeks
5y ago
Agree. Having this function exit if any arguments are passed to it seems like a good safety measure.
[–]
TheSkyHasEyes
5y ago
ren would be better than rn. :)
[–]
eyelidlessness
5y ago
Note to self: snag “notTerseAtAllMoreVerboseIdentifiersForGreatGood.js” on NPM