22 lipca 2012

Beautiful code - review

A few days ago I have finished reading 'Beautiful Code'. It is a book that gathers 34 articles written by well-known software designers and edited by Andy Oram and Greg Wilson. The intention of Oram's and Wilson's was to create a book where IT stars will show how they attack some specific problem and provide elegant and clear solutions. So idea for this book was really noble. What about realization ?


I have bought this book while 33rd degree in Cracow. Beside idea behind this book I really liked that it is not connected to any particular technology or language. Each author uses technology with which he feels comfortable. I was never a person who knows only one programming language and use it as golden hammer. Instead of that Im trying to follow a rule 'You must know everything about something and something about everything'. That's why I have decided to buy it. However after finishing this book I felt very disappointed.

Book is  very academic. You can find in its many variation of Quicksort algorithm, some clever operations on bits or parser of regular expressions. What's more most of chapters are quite hard to understand and require a lot of attention from reader just to get know in how awesome way you can implement the Gaussian elimination. I must admit that the Gaussian elimination is not even close to my interest.

However because book is about beautiful code and appealing solutions I decided to not write about chapters that are dull in my opinion. Instead I will focus on chapters that are good and worth of reading. I will mention them in the same order that they appear in a book.

  • Chapter 4 "Finding Things" - Two main conclusions from this chapter: Ruby is awesome and don't trust always O notation because you don't know how big constants are hiding behind them.
  • Chapter 5 "Correct, Beautiful, Fast (in That Order): Lessons from Designing XML Verifiers" - This chapter is something. Author step by step present designing process, challenges and decisions of creating XML Verifiers library. A trick presented at the end of this chapter is amazing.
  • Chapter 7 "Beautiful Tests" - Do you know how hard is to write reliable tests ? How much effort does it cost ? Is it possible to have beautiful tests ? If you want know then you need to read this chapter.
  • Chapter 18 "Python's Dictionary Implementation: Being All Things to All People" - Actually I know a little bit about how dictionaries (or hashes, however you going to call them)  are working. Nevertheless I think that this chapter is worth reading even if you know what kind of magic is working behind the scene.
  • Chapter 20 "A Highly Reliable Enterprise System for NASA's Mars Rover Mission" - Quite easy and general chapter about technology used in NASA. Some simple Java server side code examples and why J2EE fits perfectly to NASA project requirements.
  •  Chapter 23 "Distributed Programming with MapReduce" - This is probably the best chapter in the whole book. Several times I have tried to read about MapReduce, but I have always failed because explanation of this mechanism was very enigmatic. This chapter presents MapReduce in nice and easy way that I think that everyone can understand it. Really, really encourage to read.
  • Chapter 24 "Beautiful Concurrency" - If you have ever try to write a multithreading system in language like Java you know how much pain in the ass it is. Of course you can use actors pattern and try to avoid any state sharing between threads but what if you can't do that ? Well, that means you need to look at STM. In this chapter idea of STM is presented in Haskell but I'm quite sure it will not cause any difficulties to get it right. Very good chapter.
  • Chapter 27 "Integrating Business Partners the RESTful Way" - Not sure if this chapter is good or I  chose it because I'm enthusiast of RESTful architecture. If you want to know why you should decide (or not) to use RESTful approach this chapter is for you.
  • Chapter 28 "Beautiful Debugging" - Funny chapter about debugging debugger with debugger.
  • Chapter 29 "Treating Code As an Essay" - Very short chapter with some ideas about software development by Ruby founder.
One more thing bears noting. I'm a Java programmer and I look at this book from Java programmer perspective. It means that some chapters that have a code in C or C++ are a little bit more difficult for me then chapters with Ruby or Java. That's why you can have different feelings about this book then I have and it is good. If you want to share your thoughts about 'Beautiful code' feel free to use comments !

Brak komentarzy:

Prześlij komentarz