Wandering Thoughts archives

2008-06-28

The other reason that shells should be programmable

I gave several sensible low-level reasons why Unix shells should be programmable in WhyShellLanguages. But the higher level reason why is simpler: shells should be programmable because it helps people grow their expertise.

If doing sophisticated Unix glue things is done with a separate language, there is a huge barrier to entry; you have to learn an entirely new language before you can start doing even relatively small things. Many ordinary users are simply not going to have either the interest or the time to invest (especially when it may not be clear if they can get anything they're interested out of it).

By contrast, letting the shell be programmable in the same language that you use at the command prompt lets you grow slowly in your usual environment. Learning a little bit immediately makes you a little bit more productive (assuming that you pick the right little bits), which gives you good feedback and thus encourages more learning.

(I also believe that things are easier to learn when you can immediately apply them and thus both test and reinforce your knowledge. It's sort of like testing a program bit by bit as you write it, instead of writing it all and only then testing it at the end.)

Or in short: a programmable shell encourages starting users to become expert users by giving them a shallow learning curve with immediate rewards.

(A sub-case of this is learning how to write and customize your own dotfiles, although the more I think about it the more I suspect that most people start out with aliases and little commands.)

Note that there is a chicken and egg problem here if you have to understand how to program your shell in order to see what being able to program your shell can get you. One advantage of decent programmable shells is that it's relatively clear in advance what you get from learning a bit of shell programming; you get to wrap conditions and logic around your commands.

unix/WhyShellLanguagesII written at 01:04:50; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.