docs/master
diff ch03.roff @ 12:7ca384d68edc
Wrote some text for removal of old code.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Fri, 20 Apr 2012 19:14:56 +0200 |
parents | dc2bfef4cda7 |
children | 55ec590cfa07 |
line diff
1.1 --- a/ch03.roff Fri Apr 20 19:14:30 2012 +0200 1.2 +++ b/ch03.roff Fri Apr 20 19:14:56 2012 +0200 1.3 @@ -4,9 +4,119 @@ 1.4 .P 1.5 bar 1.6 1.7 -.H1 "Removal of Old Stuff 1.8 +.H1 "Removal of Code Relicts 1.9 .P 1.10 -foo 1.11 +The code base of mmh originates in the late 70s, had been extensively 1.12 +worked on in the mid 80s, and had been partly reorganized and extended 1.13 +in the 90s. Relicts of all those times had gathered in the code base. 1.14 +My goal was to remove any ancient code parts. One part of the task was 1.15 +converting obsolete code constructs to standard constructs, the other part 1.16 +was dropping obsolete functions. 1.17 +.P 1.18 +As I'm not even thirty years old and have no more than seven years of 1.19 +Unix experience, I needed to learn about the history in retroperspective. 1.20 +Older people likely have used those ancient constructs themself 1.21 +and have suffered from their incompatiblities and have longed for 1.22 +standardization. Unfortunately, I have only read that others had done so. 1.23 +This put me in a much more difficult positions when working on the old 1.24 +code. I needed to recherche what other would have known by heart from 1.25 +experience. All my programming experience comes from a time past ANSI C 1.26 +and past POSIX. Although I knew about the times before, I took the 1.27 +current state implicitely for granted most of the time. 1.28 +.P 1.29 +Being aware of 1.30 +these facts, I rather let people with more historic experience solve the 1.31 +task of converting the ancient code constructs to standardized ones. 1.32 +Luckily, Lyndon Nerenberg focused on this task at the nmh project. 1.33 +He converted large parts of the code to POSIX constructs, removing 1.34 +the conditionals compilation for now standardized features. 1.35 +I'm thankful for this task being solved. I only pulled the changes into 1.36 +mmh. 1.37 +.P 1.38 +The other task of dropping ancient functionality to remove old code, 1.39 +I did myself, though. My position to strip mmh to the bare minimum of 1.40 +frequently used features is much more revolutional than the nmh community 1.41 +sees it. Without the need to justify my decisions, I was able to quickly 1.42 +remove code I considered ancient. The need to discuss my decisions with 1.43 +peers likely would have slowed this process down. Of course, I did research 1.44 +if a particular feature really should be dropped. Having not had any 1.45 +contact to this feature within my computer life was a first indicator to 1.46 +drop it, but I also asked others and searched the literature for modern 1.47 +usage of the feature. If it appeared to be truly ancient, I dropped it. 1.48 +The reason for dropping is always part of the commit message in the 1.49 +version control system. Thus, it is easy for others to check their 1.50 +view on the topic with mine and possibly to argue for reinclusion. 1.51 + 1.52 +.U2 "MMDF maildrop support 1.53 +.P 1.54 +I did drop any support for the MMDF maildrop format. This type of format 1.55 +is conceptionally similar to the mbox format, but uses four bytes with 1.56 +value 1 (\fL^A^A^A^A\fP) as message delimiter, 1.57 +instead of the string ``\fLFrom\0\fP''. 1.58 +Due to the similarity and mbox being the de-facto standard maildrop 1.59 +format on Unix, but also due to the larger influence of Sendmail than MMDF, 1.60 +the MMDF maildrop format had vanished. 1.61 +.P 1.62 +The simplifications within the code were only moderate. Switches could 1.63 +be removed from tools like 1.64 +.L packf , 1.65 +which generate packed mailboxes. Only one packed mailbox format remained: 1.66 +mbox. 1.67 +The most important changes affect the equally named mail parsing routine in 1.68 +.L sbr/m_getfld.c . 1.69 +The direct MMDF code had been removed, but as now only one packed mailbox 1.70 +format is left, code structure simplifications are likely possible. 1.71 +The reason why they are still outstanding is the heavily optimized code 1.72 +of \fLm_getfld()\fP. Changes beyond a small local scope \(en 1.73 +which restructuring in its core is \(en cause a high risk of damaging 1.74 +the intricate workings of the optimized code. This problem is know 1.75 +to the developers of nmh, too. They also avoid touching this minefield 1.76 +if possible. 1.77 + 1.78 +.U2 "UUCP Bang Paths 1.79 +.P 1.80 +More questionably than the former topic is the removal of support for the 1.81 +UUCP bang path address style. However, the user may translate the bang 1.82 +paths on retrieval to Internet addresses and the other way on posting 1.83 +messages. The former can be done my an MDA like procmail; the latter 1.84 +by a sendmail wrapper. This would ensure that any address handling would 1.85 +work as expected. However, it might just work well without any 1.86 +such modifications, as mmh does not touch addresses much, in general. 1.87 +But I can't ensure as I have never used an environment with bang paths. 1.88 +Also, the behavior might break at any point in further development. 1.89 + 1.90 +.U2 "Hardcopy terminal support 1.91 +.P 1.92 +More of a funny anecdote is the remaining of a check for printing to a 1.93 +hardcopy terminal until Spring 2012, when I finally removed it. 1.94 +I surely would be very happy to see such a terminal in action, maybe 1.95 +actually being able to work on it, but I fear my chances are null. 1.96 +.P 1.97 +The check only prevented a pager to be placed between the outputting 1.98 +program (\fLmhl\fP) and the terminal. This could have been ensured with 1.99 +the \fL-nomoreproc\fP at the command line statically, too. 1.100 + 1.101 +.U2 "Removed support for header fields 1.102 +.P 1.103 +The `Encrypted' header had been introduced by RFC\^822, but already 1.104 +marked legacy in RFC 2822. It was superseded by FIXME. 1.105 +Mmh does no more support this header. 1.106 +.P 1.107 +`Content-MD5' headers were introduced by RFC\^1864. They provide only 1.108 +a verification of data corruption during the transfer. By no means can 1.109 +they ensure verbatim end-to-end delivery of the contents. This is clearly 1.110 +stated in the RFC. The proper approach to provide verificationability 1.111 +of content in an end-to-end relationship is the use of digital cryptography 1.112 +(RFCs FIXME). On the other hand, transfer protocols should ensure the 1.113 +integrity of the transmission. In combinations these two approaches 1.114 +make the `Content-MD5' header field useless. In consequence, I removed 1.115 +the support for it. By this removal, MD5 computation is not needed 1.116 +anywhere in mmh. Hence, over 500 lines of code were removed by this one 1.117 +change. Even if the `Content-MD5' header field is useful sometimes, 1.118 +I value its usefulnes less than the improvement in maintainability, caused 1.119 +by the removal. 1.120 + 1.121 + 1.122 1.123 .H1 "Paths to ... 1.124 .P