docs/unix-phil

diff unix-phil.ms @ 10:355ed69a34a8

more about the shell and worse is better (ch03)
author meillo@marmaro.de
date Sat, 20 Feb 2010 12:14:01 +0100
parents 529168f49f29
children b32a43a62cae
line diff
     1.1 --- a/unix-phil.ms	Fri Feb 19 23:11:09 2010 +0100
     1.2 +++ b/unix-phil.ms	Sat Feb 20 12:14:01 2010 +0100
     1.3 @@ -32,7 +32,7 @@
     1.4  Knowing and following the tenets of the Unix Philosophy makes software more valuable.
     1.5  .AE
     1.6  
     1.7 -.if t .2C
     1.8 +.\".if t .2C
     1.9  
    1.10  .FS
    1.11  .ps -1
    1.12 @@ -394,16 +394,16 @@
    1.13  .SH
    1.14  A powerful shell
    1.15  .LP
    1.16 -The Unix shell provides the possibility to combine small programs into
    1.17 -large ones easily.
    1.18 -But the powerful shell is great feature in other ways, too.
    1.19 +It was already said, that the Unix shell provides the possibility to
    1.20 +combine small programs into large ones easily.
    1.21 +A powerful shell is a great feature in other ways, too.
    1.22  .PP
    1.23 -It encourages rapid prototyping.
    1.24 -It includes a scripting language with built in control statements.
    1.25 +For instance by including a scripting language.
    1.26 +The control statements are build into the shell.
    1.27  The functions, however, are the normal programs, everyone can use on the system.
    1.28 -Thus, the programs are known and learning to program in the shell is easy.
    1.29 +Thus, the programs are known, so learning to program in the shell is easy.
    1.30  Using normal programs as functions in the shell programming language
    1.31 -is only possible because they are small, combinable tools in a toolchest style.
    1.32 +is only possible because they are small and combinable tools in a toolchest style.
    1.33  .PP
    1.34  The Unix shell encourages to write small scripts out of other programs,
    1.35  because it is so easy to do.
    1.36 @@ -416,6 +416,89 @@
    1.37  a mechanism to combine parts to larger parts, and an easy way to automate tasks,
    1.38  this will inevitably produce software leverage.
    1.39  Getting multiple times the benefit of an investment is a great offer.
    1.40 +.PP
    1.41 +The shell also encourages rapid prototyping.
    1.42 +Many well known programs started as quickly hacked shell scripts,
    1.43 +and turned into ``real'' programs, written in C, later.
    1.44 +Building a prototype first is a way to avoid the biggest problems
    1.45 +in application development.
    1.46 +Fred Brooks writes in ``No Silver Bullet'':
    1.47 +.[
    1.48 +%A Frederick P. Brooks, Jr.
    1.49 +%T No Silver Bullet: Essence and Accidents of Software Engineering
    1.50 +%B Information Processing 1986, the Proceedings of the IFIP Tenth World Computing Conference
    1.51 +%E H.-J. Kugler
    1.52 +%D 1986
    1.53 +%P 1069\(en1076
    1.54 +%I Elsevier Science B.V.
    1.55 +%C Amsterdam, The Netherlands
    1.56 +.]
    1.57 +.QP
    1.58 +The hardest single part of building a software system is deciding precisely what to build.
    1.59 +No other part of the conceptual work is so difficult as establishing the detailed
    1.60 +technical requirements, [...].
    1.61 +No other part of the work so cripples the resulting system if done wrong.
    1.62 +No other part is more difficult to rectify later.
    1.63 +.PP
    1.64 +Writing a prototype is a great method to become familiar with the requirements
    1.65 +and to actually run into real problems.
    1.66 +Today, prototyping is often seen as a first step in building a software.
    1.67 +This is, of course, good.
    1.68 +However, the Unix Philosophy has an \fIadditional\fP perspective on prototyping:
    1.69 +After having built the prototype, one might notice, that the prototype is already
    1.70 +\fIgood enough\fP.
    1.71 +Hence, no reimplementation, in a more sophisticated programming language, might be of need,
    1.72 +for the moment.
    1.73 +Maybe later, it might be neccessary to rewrite the software, but not now.
    1.74 +.PP
    1.75 +By delaying further work, one keeps the flexibility to react easily on
    1.76 +changing requirements.
    1.77 +Software parts that are not written will not miss the requirements.
    1.78 +
    1.79 +.SH
    1.80 +Worse is better
    1.81 +.LP
    1.82 +The Unix Philosophy aims for the 80% solution;
    1.83 +others call it the ``Worse is better'' approach.
    1.84 +.PP
    1.85 +First, practical experience shows, that it is almost never possible to define the
    1.86 +requirements completely and correctly the first time.
    1.87 +Hence one should not try to; it will fail anyway.
    1.88 +Second, practical experience shows, that requirements change during time.
    1.89 +Hence it is best to delay requirement-based design decisions as long as possible.
    1.90 +Also, the software should be small and flexible as long as possible
    1.91 +to react on changing requirements.
    1.92 +Shell scripts, for example, are more easily adjusted as C programs.
    1.93 +Third, practical experience shows, that maintenance is hard work.
    1.94 +Hence, one should keep the amount of software as small as possible;
    1.95 +it should just fulfill the \fIcurrent\fP requirements.
    1.96 +Software parts that will be written later, do not need maintenance now.
    1.97 +.PP
    1.98 +Starting with a prototype in a scripting language has several advantages:
    1.99 +.IP \(bu
   1.100 +As the initial effort is low, one will likely start right away.
   1.101 +.IP \(bu
   1.102 +As working parts are available soon, the real requirements can get identified soon.
   1.103 +.IP \(bu
   1.104 +When a software is usable, it gets used, and thus tested.
   1.105 +Hence problems will be found at early stages of the development.
   1.106 +.IP \(bu
   1.107 +The prototype might be enough for the moment,
   1.108 +thus further work on the software can be delayed to a time
   1.109 +when one knows better about the requirements and problems,
   1.110 +than now.
   1.111 +.IP \(bu
   1.112 +Implementing now only the parts that are actually needed now,
   1.113 +requires fewer maintenance work.
   1.114 +.IP \(bu
   1.115 +If the global situation changes so that the software is not needed anymore,
   1.116 +then less effort was spent into the project, than it would have be
   1.117 +when a different approach had been used.
   1.118 +
   1.119 +
   1.120 +
   1.121 +
   1.122 +
   1.123  
   1.124  
   1.125