Hacker News new | ask | show | jobs
by benhalllondon 4831 days ago
Great, excellent, fun.

But, clearly, it should run 'ls' after doing its choo choo?

4 comments

That is optimizing for the short term. "When I've run sl, I clearly wanted ls, so you should give me that (even if you also punish me)."

Optimizing for the long term is also plausible. "Don't reward me for making mistakes (even if you also punish me) because it'll dilute my muscle-memory training, and I'll be more likely to make mistakes in the future."

Neither of these is inherently more correct than the other. The long term has more uncertainty, but greater potential rewards. We just have to make a judgment call.

I tend to favor the long-term approach for sl. I can't easily quantify how valuable my stricter muscle-memory training will be, but I can imagine the possibility of a significant upside if I actually become a more precise typer. Also, the worst-case downside just isn't that bad -- retyping ls just isn't that hard.

Well, this forces you to type 'ls' again, giving you another chance to see the awesome locomotive! ;)
The Unix philosophy is that a program should only do one thing. sl only does one thing.
One could use a shell alias, a function or something similar for that.
alias sl='sl;ls'