Y
Hacker News
new
|
ask
|
show
|
jobs
by
tgbugs
1681 days 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.
5 comments
spurgu
1681 days ago
One char away also physically on the keyboard (maybe that's what you meant?).
link
tgbugs
1681 days 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.
link
jatone
1681 days ago
laughs in dvorak
link
kataklasm
1681 days ago
cries in colemak
link
Extigy
1681 days ago
I once ran “crontab -r” instead of “crontab -e” and also thought that was terrible design for the same reason.
link
post-it
1681 days ago
Looks like it's typically run without any arguments, so it's probably fine.
link
lioeters
1681 days 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.
link
itsbenweeks
1677 days ago
Agree. Having this function exit if any arguments are passed to it seems like a good safety measure.
link
TheSkyHasEyes
1681 days ago
ren would be better than rn. :)
link
eyelidlessness
1681 days ago
Note to self: snag “notTerseAtAllMoreVerboseIdentifiersForGreatGood.js” on NPM
link