Subj : Re: Academic grades and programming To : comp.programming From : Jon Harrop Date : Tue Jul 26 2005 07:46 pm Arthur J. O'Dwyer wrote: >> Lots of open source software is written in academia, e.g. OCaml and much >> of Linux, and is of very high quality. I'd be hard pressed to think of >> any high quality commercial code, other than my own. ;-) > > Note that the opposite of "commercial" is not "open source." I can't > tell whether you mean you've never seen any decent commercial open-source > code (bad), or just that you haven't seen any decent closed-source code > (which is to be expected, given that few people see any closed-source > code of any quality, by definition!). Let's see. I saw quite a bit of closed-source commercial code when I was working at BP about ten years ago. I worked on something called the Management Information System (MIS) and it had about 10 remote clients on semi-dumb terminals. It included its own language called UFI, which was a cross between BASIC and C. The system had lots of UFI programs which collated information, built reports and sent them to relevant people. The MIS system was appallingly badly written from the ground up. We did not have direct control over the UFI interpreter and were stuck with its many quirks. In particular, I remember that the "time" function would randomly return a non-sensical value roughly every third attempt. Given that this was a real-time system designed to control oil plants, I found that rather surprising. My predecessor had resorted to using the median average time over several calls. When I met the guy who'd written it (who's company was still on a 75,000UKP p.a. support contract) and he just didn't want to know about the problems. I remember one of the more interesting bugs in his code presented an icon to users which they were told absolutely not to click on. If they clicked on it then the whole system would crash and turn itself off. I've also seen some kind-of-open-source code from the exposed parts of programs like Mathematica (particularly add-on packages). That is generally of high quality, I suspect because people keep their code closed-source if they are ashamed of it. As a Linux user, I've seen lots of open-source code. Commonly used open-source code (e.g. Linux, TeX, LyX, OCaml) is typically of very high quality. Naturally, there are many more awful programs published by newbies. > From my /extremely/ limited experience with commercial and academic > code, I do have to agree with you: Academic code is often much cleaner > conceptually. But Ivan may mean something different by "worst." For > example, most academic code I've seen tends to be written in a very > idiosyncratic coding style --- lots of whitespace or no whitespace, > many variable declarations per line, comment blocks that look > > /******************************* > /* COMMENT BLOCK > /* like this, > /*******************************/ > > and so on. But that's the easy stuff to fix. Yes. I am more concerned by fundamental flaws in commercial code. These are present in open-source code as well, of course. For example, I consider the lack of an underlying vector graphics library to be a flaw in LyX, OpenOffice, KDE etc. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .