开发者

Meaning of Perlis's Epigram #22

From Epigrams in Programming by Alan J. Perlis:

开发者_开发问答

22. A good system can't have a weak command language.

What does this mean? What are good examples of this principle?

Where can I learn more on how to implement a command langauge that meets this criteria?


You have to know some of the context in which that was formulated. The linked article was only published in 1982 and any single one of those epigrams could be decades older. However, even 1982 was before my time, and my relevant impressions of then are:

  • Computer systems were more highly specialized to a specific task.
  • Systems had dedicated operators (who weren't programmers) trained on specific systems.
  • Knowledge of one system did not easily transfer to another system. (Today you train operators on specific programs, but rarely on specific hardware+OS combinations. In other words, systems have become more similar and adopted standards and conventions.)

The "command language" just means shell scripting today. Remember that at a shell prompt you enter "commands".

Those basics out of the way, this is speaking to me about The Unix Way™.

Compare to how Windows programs can have a much harder time with automation and many programs (and even the OS) require a GUI to change some settings. (The attitude towards that is somewhat changing with Microsoft PowerShell, but it's still missing the decades of experience in following this principle that other operating systems have.)

Futhermore, when the basic mode of operation for any user is your system's command language (as it was for Unix in 1982), then your command language is strong in another way: all users know how to use it and don't have to learn separate tools. In that situation there's nothing the system can do which the command language can't accomplish, because the command language effectively is the system.

I know of no single resource that spells out all of these ideas and that you can use as a roadmap to implement your own command language. The concept is more ethereal than written in stone, as the other epigrams also are in general. I encourage you to read about Unix in general, shells (e.g. POSIX's standard for sh, and others such as bash), other shell scripting languages (anything with a shebang line, such as Perl and Python), and so forth.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜