Beautiful Code

I’ve been reading Beautiful Code from time to time during the autumn. It’s mixed bag and I actually skipped some chapter that was too deep into maths for my taste. Chapter 22: A Spoonful of Sewage was an instant favorite; it is a a fascinating head-first dive into a bug hunt in Sun Solaris’ synchronization primitives. It was a bit over my head but interesting nevertheless. Another very interesting chapter was Chapter 23: Distributed Programming with MapReduce about Google’s “programming system for large-scale data processing problems”.

Only because of the title of this blog, I’d like to mention that more than one chapter mentions the Divide and Conquer approach used by the Quick Sort algorithm, including using a subtle bug found in early (or naive) C, C++ and Java implementations to show off JUnit.

I’ve thought of sorting the chapters by programming languages and see what language the most author used for his or her beautiful code. At least Lisp, Python, Perl, Ruby, Java, C# and C++ are present. Some day I want to do a bit of Lisp programming, but I haven’t found a suitable project yet. Maybe I should buy a Lisp book too first…

Where is my own Beautiful Code then? If “get the job done” is considered beautiful, it could be the PHP code for any of my web sites! 🙂 I’m pretty happy about the architecture for my unfinished MidaSync project; maybe I should try to describe it here some day.

For MidaSync I also wrote a D-BUS wrapper for C++ that I’m quite proud of, but at some point it became a bit “magic”. For example it relies on the presence of a partial specialization to create a D-BUS path from an object exposed through D-BUS. I’ve never released this properly and I think that the D-BUS wrapper in OpenWengo is used by today’s C++ developers in need of D-BUS support.

Leave a Reply

Your email address will not be published. Required fields are marked *