Mercurial > docs > master
comparison ch03.roff @ 93:093ccf39a45e
Write text about removal of switches; Included the grap figure.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Fri, 15 Jun 2012 23:37:58 +0200 |
parents | 83bfb4dbf59f |
children | edac7e46a9f2 |
comparison
equal
deleted
inserted
replaced
92:e6f95015ba61 | 93:093ccf39a45e |
---|---|
934 This option is likely to stay. | 934 This option is likely to stay. |
935 | 935 |
936 | 936 |
937 | 937 |
938 | 938 |
939 .H2 "Removal of switches | 939 .H2 "Removal of Switches |
940 .P | 940 .P |
941 | 941 The command line switches of MH tools follow the X Window style. |
942 | 942 They are words, introduced by a single dash. |
943 | 943 For example: |
944 .Cl "-truncate" . | |
945 Every program in mmh has two generic switches: | |
946 .Sw -help , | |
947 to print a short message on how to use the program, and | |
948 .Sw -Version , | |
949 to tell what version of mmh the program belongs to. | |
950 .P | |
951 Switches change the behavior of programs. | |
952 Programs that do one thing in one way require no switches. | |
953 In most cases, doing something in exactly one way is too limiting. | |
954 If it is basically the same task to accomplish, but it should be done | |
955 in various ways, switches are a good approach to alter the behavior | |
956 of a program. | |
957 Changing the behavior of programs provides flexibility and customization | |
958 to users, but in the same way it complicates the code, documentation and | |
959 usage of the program. | |
960 Therefore, the number of switches should be kept small. | |
961 A small set of well-chosen switches does no harm. | |
962 But usually, the number of switches increases over time. | |
963 Already in 1985, Rose and Romine have identified this as a major | |
964 problem of MH: | |
965 .[ [ | |
966 rose romine real work | |
967 .], p. 12] | |
968 .sp | |
969 .QP | |
970 A complaint often heard about systems which undergo substantial development | |
971 by many people over a number of years, is that more and more options are | |
972 introduced which add little to the functionality but greatly increase the | |
973 amount of information a user needs to know in order to get useful work done. | |
974 This is usually referred to as creeping featurism. | |
975 .QP | |
976 Unfortunately MH, having undergone six years of off-and-on development by | |
977 ten or so well-meaning programmers (the present authors included), | |
978 suffers mightily from this. | |
979 .sp | |
980 .P | |
981 Adding new switches only reluctantly is one part of the counter-action, | |
982 the other is removing hardly used switches. | |
983 Now that there are lots of switches already implemented, | |
984 removing some of them is more important. | |
985 Removing existing functionality is always difficult because it | |
986 breaks programs that use these functions. | |
987 Also, for every obsolete feature, there'll always be someone who still | |
988 uses it and thus opposes its removal. | |
989 This puts the developer into the position, | |
990 where sensible improvements to style are regarded as destructive acts. | |
991 Yet, living with the featurism is far worse, in my eyes. | |
992 Future needs will demand adding new features, | |
993 worsening the situation more and more. | |
994 Rose and Romine added in a footnote, | |
995 ``[...] | |
996 .Pn send | |
997 will no doubt acquire an endless number of switches in the years to come.'' | |
998 Although clearly humorous, the comment displays the nature of | |
999 the problem. | |
1000 Though refusing to add any new switches would encounter the problem | |
1001 at its root, it is not practical. | |
1002 But removing obsolete switches is an effective approach to deal with the | |
1003 problem. | |
1004 Working on an experimental branch, | |
1005 eased this work because I had not to offend users. | |
1006 .P | |
1007 Rose and Romine counted 24 visible and 9 more hidden switches for | |
1008 .Pn send . | |
1009 At the beginning of mmh, it were 32 visible and 12 hidden ones. | |
1010 At the time of writing, mmh's | |
1011 .Pn send | |
1012 has 7 visible switches and 1 hidden switch. | |
1013 (In each of the examples, the two generic help and version switches | |
1014 are included.) | |
1015 .P | |
1016 Figure XXX | |
1017 .\" XXX Ref | |
1018 displays the number of switches for each of the tools that was not | |
1019 removed from or newly added to mmh. | |
1020 Both, visible and hidden switches, were counted, but | |
1021 not the generic help and version switches. | |
1022 Whereas in the beginning of the project, the average tool had 11 switches, | |
1023 now it has no more than 5 \(en only half as many. | |
1024 If the `no' switches and similar inverse variant are folded onto | |
1025 their counter-parts, the numbers are 8 in pre-mmh to 4 now. | |
1026 The total number of functional switches in mmh dropped from 465 | |
1027 to 234. | |
1028 | |
1029 .KS | |
1030 .in 1c | |
1031 .so input/switches.grap | |
1032 .KE | |
1033 | |
1034 .P | |
1035 A part of the switches vanished after functions were removed. | |
1036 This was the case for network mail transfer, for instance. | |
1037 Sometimes the work flow was the other way: | |
1038 The trying to reduce the number of switches suggested the removal of | |
1039 functions. | |
1040 | |
1041 .U3 "Draft Folder Facility | |
1042 .P | |
1043 A change early in the project was the completely transition from | |
1044 the single draft message to the draft folder facility. | |
1045 The draft folder facility was introduced in the mid-Eighties. | |
1046 (Rose and Romine called it a ``relatively new feature'' | |
1047 .[ | |
1048 rose romine real work | |
1049 .] | |
1050 in 1985.) | |
1051 Since then, the facility had existed but had remained deactive by default. | |
1052 The default activation and the related rework of the tools made it | |
1053 possible to remove the | |
1054 .Sw -[no]draftfolder , | |
1055 and | |
1056 .Sw -draftmessage | |
1057 switches from | |
1058 .Pn comp , | |
1059 .Pn repl , | |
1060 .Pn forw , | |
1061 .Pn dist , | |
1062 .Pn whatnow , | |
1063 and | |
1064 .Pn send . | |
1065 The only flexibility removed is having multiple draft folders | |
1066 within one profile. | |
1067 I consider this only a theoretical setup. | |
1068 In the same go, the | |
1069 .Sw -draft | |
1070 switch of | |
1071 .Pn anno , | |
1072 .Pn refile , | |
1073 and | |
1074 .Pn send | |
1075 was removed. | |
1076 The special-casing of `the' draft message became irrelevant after | |
1077 the rework of the draft system. | |
1078 (See Sec. XXX.) | |
1079 | |
1080 .U3 "Inplace | |
1081 .P | |
1082 .Pn anno | |
1083 had the switches | |
1084 .Sw -[no]inplace | |
1085 to either annotate the message inplace and thus preserve hard links, | |
1086 or annotate a copy to replace the original message, breaking hard links. | |
1087 Following the assumption that linked messages are the same message, | |
1088 and annotating it should not break the link, the | |
1089 .Sw -[no]inplace | |
1090 switches were removed and the previous default | |
1091 .Sw -inplace | |
1092 was made the only behavior. | |
1093 The | |
1094 .Sw -[no]inplace | |
1095 switches of | |
1096 .Pn repl , | |
1097 .Pn forw , | |
1098 and | |
1099 .Pn dist | |
1100 could be removed, too, as they were simply passed through to | |
1101 .Pn anno . | |
1102 .P | |
1103 .Pn burst | |
1104 also had | |
1105 .Sw -[no]inplace | |
1106 switches, but they had different meaning, as written in nmh's | |
1107 .Mp burst(1) | |
1108 man page: | |
1109 .sp | |
1110 .QP | |
1111 If -noinplace is given, each digest is preserved, no table | |
1112 of contents is produced, and the messages contained within | |
1113 the digest are placed at the end of the folder. Other messages | |
1114 are not tampered with in any way. | |
1115 .sp | |
1116 .P | |
1117 With | |
1118 .Sw -inplace , | |
1119 the digest had been replaced by the table of contents (i.e. the | |
1120 introduction text) and the bursted messages were placed right | |
1121 after this message, renumbering all following messages. | |
1122 Also, any trailing text of the digest will be lost, though, | |
1123 in practice, it usually consists of an end-of-digest marker only. | |
1124 The decision to drop the | |
1125 .Sw -inplace | |
1126 behavior was supported by the complexity and possible data loss | |
1127 it introduced. | |
1128 .Sw -noinplace | |
1129 was the default behavior already and is the chosen behavior now. | |
1130 | |
1131 .U3 "mbox and MMDF | |
1132 .P | |
1133 packf: file mbox mmdf | |
1134 rcvpack: mbox mmdf | |
1135 | |
1136 | |
1137 .ig | |
1138 | |
1139 ap: width | |
1140 dp: width | |
1141 burst: [no]quiet | |
1142 flist: [no]total | |
1143 folder: [no]header | |
1144 | |
1145 comp: file | |
1146 dist: file(msh) | |
1147 forw: filter, [no]mime, [no]dashstuffing(mhl) | |
1148 repl: [no]format/filter width | |
1149 | |
1150 mhmail: resent queued | |
1151 inc: snoop, (pop) | |
1152 mhbuild: [no]check, [no]ebcdicsafe, [no]headers, [no]list, [no]realsize | |
1153 [no]rfc934mode, [no]contentid (caching) | |
1154 mhlist: [no]check [no]headers [no]realsize (caching) | |
1155 mhstore: [no]check [no]verbose (caching) | |
1156 | |
1157 scan: [no]clear [no]header [no]reverse | |
1158 | |
1159 mhl: [no]bell [no]clear [no]faceproc folder [no]moreproc length sleep | |
1160 [no]dashstuffing(forw) digest list volume number issue number | |
1161 mhshow: [no]check [no]pause [no]serialonly (caching) [no]moreproc | |
1162 length width | |
1163 | |
1164 prompter: erase kill [no]doteof | |
1165 | |
1166 refile: [no]preserve [no]unlink [no]rmmproc | |
1167 | |
1168 send: filter [no]format [no]forward [no]mime [no]msgid | |
1169 [no]push split [no]unique (sasl) width snoop [no]dashstuffing | |
1170 attach attachformat | |
1171 whatnow: (noedit) attach | |
1172 | |
1173 slocal: [no]suppressdups | |
1174 | |
1175 sortm: subject | |
1176 | |
1177 spost: [no]filter [no]format [no]remove [no]backup width [no]push idanno | |
1178 [no]check(whom) whom(whom) | |
1179 | |
1180 whom: ??? | |
1181 | |
1182 | |
1183 (pop) host, port, user, [no]pack, proxy | |
1184 (smtp) mail saml send soml client server user port | |
1185 (sasl) sasl, saslmech | |
1186 (tls) | |
1187 (caching) rcache wcache | |
1188 | |
1189 noedit | |
1190 nowhatnowproc | |
1191 | |
1192 | |
1193 format -> form | |
1194 | |
1195 version -> Version | |
1196 | |
1197 .. | |
1198 | |
1199 .ig | |
1200 | |
1201 .P | |
1202 To ease typing, the switches can be abbreviated as much as the remaining | |
1203 prefix remains unambiguous. | |
1204 If in our example no other switch would start with the letter `t', then | |
1205 .Cl "-truncate" , | |
1206 .Cl "-trunc" , | |
1207 .Cl "-tr" , | |
1208 and | |
1209 .Cl "-t | |
1210 would all be the same. | |
1211 As a result, switches can neither be grouped (as in | |
1212 .Cl "ls -ltr" ) | |
1213 nor can switch arguments be appended directly to the switch (as in | |
1214 .Cl "sendmail -q30m" ). | |
1215 .P | |
1216 Many switches have negating counter-parts, which start with `no'. | |
1217 For example | |
1218 .Cl "-notruncate | |
1219 inverts the | |
1220 .Cl "-truncate | |
1221 switch. | |
1222 They exist to undo the effect of default switches in the profile. | |
1223 If the user has chosen to change the default behavior of some tool | |
1224 by adding a default switch to the profile, | |
1225 he can still undo this change in behavior by specifiying the inverse | |
1226 switch on the command line. | |
1227 .P | |
1228 In the best case, all switches are unambiguous on the first character, | |
1229 or on the three-letter prefix for the `no' variants. | |
1230 Reducing switch prefix collisions, shortens the necessary prefix lenght | |
1231 the user must type. | |
1232 Having less switches helps best. | |
1233 | |
1234 .. | |
944 | 1235 |
945 .H1 "Modernizing | 1236 .H1 "Modernizing |
946 | 1237 |
947 | 1238 |
948 .H2 "Removal of Code Relicts | 1239 .H2 "Removal of Code Relicts |