Any "Pretty" Code Out There?
andhow writes "Practically any time I hear a large software system discussed I hear "X is a #%@!in mess," or "Y is unmanageable and really should be rewritten." Some of this I know is just fresh programmers seeing their first big hunk o' code and having the natural reaction. In other cases I've heard it from main developers, so I'll take their word for it. Over time, it paints a bleak picture, and I'd be really like to know of a counterexample. Getting to know a piece of software well enough to ascertain its quality takes a long time, so I submit to the experience of the readership: what projects have you worked on which you felt had admirable code, both high-level architecture and in-the-trenches implementation? In particular I am interested in large user applications using modern C++ libraries and techniques like exception handling and RAII."
You have the reading comprehension of something that doesn't have a very admirable level of reading comprehension. It's only random the first time you call it, and apparently qmail calls it many more times than that. At the very least, the author of the code could have stored the return value in a global and used that to avoid making a system call a bunch of times on each connection. Beyond that, its usage also seemed pretty braindead (random timeouts using getpid()?). On another note, I'm willing to bet that the person asking /. this question has spent more time reading about writing code than he/she has spent actually writing code.
Why can't they just leave a good thing alone?
Someone hit C with an ugly stick and called it a language. C++ was *never* a good thing.
Microsoft is to software what Budweiser is to beer.