Mercurial > docs > master
view 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 wrap: on
line source
.H0 "Work Report .P foo .P bar .H1 "Removal of Code Relicts .P The code base of mmh originates in the late 70s, had been extensively worked on in the mid 80s, and had been partly reorganized and extended in the 90s. Relicts of all those times had gathered in the code base. My goal was to remove any ancient code parts. One part of the task was converting obsolete code constructs to standard constructs, the other part was dropping obsolete functions. .P As I'm not even thirty years old and have no more than seven years of Unix experience, I needed to learn about the history in retroperspective. Older people likely have used those ancient constructs themself and have suffered from their incompatiblities and have longed for standardization. Unfortunately, I have only read that others had done so. This put me in a much more difficult positions when working on the old code. I needed to recherche what other would have known by heart from experience. All my programming experience comes from a time past ANSI C and past POSIX. Although I knew about the times before, I took the current state implicitely for granted most of the time. .P Being aware of these facts, I rather let people with more historic experience solve the task of converting the ancient code constructs to standardized ones. Luckily, Lyndon Nerenberg focused on this task at the nmh project. He converted large parts of the code to POSIX constructs, removing the conditionals compilation for now standardized features. I'm thankful for this task being solved. I only pulled the changes into mmh. .P The other task of dropping ancient functionality to remove old code, I did myself, though. My position to strip mmh to the bare minimum of frequently used features is much more revolutional than the nmh community sees it. Without the need to justify my decisions, I was able to quickly remove code I considered ancient. The need to discuss my decisions with peers likely would have slowed this process down. Of course, I did research if a particular feature really should be dropped. Having not had any contact to this feature within my computer life was a first indicator to drop it, but I also asked others and searched the literature for modern usage of the feature. If it appeared to be truly ancient, I dropped it. The reason for dropping is always part of the commit message in the version control system. Thus, it is easy for others to check their view on the topic with mine and possibly to argue for reinclusion. .U2 "MMDF maildrop support .P I did drop any support for the MMDF maildrop format. This type of format is conceptionally similar to the mbox format, but uses four bytes with value 1 (\fL^A^A^A^A\fP) as message delimiter, instead of the string ``\fLFrom\0\fP''. Due to the similarity and mbox being the de-facto standard maildrop format on Unix, but also due to the larger influence of Sendmail than MMDF, the MMDF maildrop format had vanished. .P The simplifications within the code were only moderate. Switches could be removed from tools like .L packf , which generate packed mailboxes. Only one packed mailbox format remained: mbox. The most important changes affect the equally named mail parsing routine in .L sbr/m_getfld.c . The direct MMDF code had been removed, but as now only one packed mailbox format is left, code structure simplifications are likely possible. The reason why they are still outstanding is the heavily optimized code of \fLm_getfld()\fP. Changes beyond a small local scope \(en which restructuring in its core is \(en cause a high risk of damaging the intricate workings of the optimized code. This problem is know to the developers of nmh, too. They also avoid touching this minefield if possible. .U2 "UUCP Bang Paths .P More questionably than the former topic is the removal of support for the UUCP bang path address style. However, the user may translate the bang paths on retrieval to Internet addresses and the other way on posting messages. The former can be done my an MDA like procmail; the latter by a sendmail wrapper. This would ensure that any address handling would work as expected. However, it might just work well without any such modifications, as mmh does not touch addresses much, in general. But I can't ensure as I have never used an environment with bang paths. Also, the behavior might break at any point in further development. .U2 "Hardcopy terminal support .P More of a funny anecdote is the remaining of a check for printing to a hardcopy terminal until Spring 2012, when I finally removed it. I surely would be very happy to see such a terminal in action, maybe actually being able to work on it, but I fear my chances are null. .P The check only prevented a pager to be placed between the outputting program (\fLmhl\fP) and the terminal. This could have been ensured with the \fL-nomoreproc\fP at the command line statically, too. .U2 "Removed support for header fields .P The `Encrypted' header had been introduced by RFC\^822, but already marked legacy in RFC 2822. It was superseded by FIXME. Mmh does no more support this header. .P `Content-MD5' headers were introduced by RFC\^1864. They provide only a verification of data corruption during the transfer. By no means can they ensure verbatim end-to-end delivery of the contents. This is clearly stated in the RFC. The proper approach to provide verificationability of content in an end-to-end relationship is the use of digital cryptography (RFCs FIXME). On the other hand, transfer protocols should ensure the integrity of the transmission. In combinations these two approaches make the `Content-MD5' header field useless. In consequence, I removed the support for it. By this removal, MD5 computation is not needed anywhere in mmh. Hence, over 500 lines of code were removed by this one change. Even if the `Content-MD5' header field is useful sometimes, I value its usefulnes less than the improvement in maintainability, caused by the removal. .H1 "Paths to ... .P foo .H1 "Path Notations .P foo .H1 "Attachments .P foo .H1 "Blind Carbon Copies .P foo .H1 "Good Defaults .P foo .H1 "Modularization .P foo .H1 "Code style .P foo