Read All About IT!

You have probably seen the “What am I doing to be a better programmer in the next 6 months” developer meme that has been doing the rounds. Along with the advice “Read more technical books”, one of the common themes is that you should read others people’s code, and lots of it!

Reading code is a great way to improve your code writing skills. This is something that I believe in, and I have to admit I’m guilty of not reading enough of other developers’ code. Find an open-source project or a developer whose work you respect, and read the code. Look for idioms and patterns, learn from their experience. I believe undergraduate computing courses should offer a course which consists of dissecting and understanding code written by prominent coders.

Scott Hanselman has a great post on the topic here, where he mentions the Coding4Fun developer kit, a great resource for learning from other people’s code.

Jeff Atwood’s post How To Become a Better Programmer by Not Programming is worth a read, if you have not seen it already.

I recently reviewed the book “Beautiful Code” from O’Reilly, a collection of articles, essays and papers from many talented programmers. It provides insights and techniques that would be hard to arrive at if you had to reinvent them yourself. There is also a dedicated web site here: http://beautifulcode.oreillynet.com/.

For a glimpse into the mind of one of Computer Science’s well known contributors, check out the “Edsger W. Dijkstra” archive (mentioned at the Beautiful Code site): http://www.cs.utexas.edu/users/EWD/

Managed Debugging Assistants

I came across this MSDN article (May 2006) by Stephen Tolub on Managed Debugging Assistants (MDAs), a CLR feature I was unaware of. Useful article, especially if you are doing any P/Invoke work. MDAs “…provide information on the CLR”s current runtime state and on events that you as a developer could not otherwise access. Some even modify runtime behaviors to help expose otherwise very hard to find bugs.”

There is a listing of all Stephen Tolub’s MSDN articles here.

Excellent Meeting, Great Turnout

And I’m not talking about Sydney APEC conference! Last night’s Perth .NET user group presentation with speaker Nick Wienholt was excellent, and we had another great turnout (I counted 47 people). Here are a few photos of the meeting:



(Apologies about the quality of the photos, they aren’t the best; I have no excuses!)

After the meeting we went for a meal at ‘Arirang’, a nearby Korean BBQ restaurant. Good thing I took a couple of photos before the BBQ got fired up, as it got a bit smokey later on (as Dave will confirm!):

Thanks to Nick Wienholt for taking time out to give a well received, very informative and useful session, and thanks to everyone for attending. Hope to see you all in a month’s time. Speaking of which, we have another guest speaker signed up who is flying in from Sydney. I’m sure most people will know him. A clue to his identity might be the topic: An introduction to Visual Studio 2008.

Thanks to Excom for providing our monthly meeting venue.

Applied Mathematics for Database Professionals. Lex de Haan and Toon Koppelaars. Apress (Book Review)

Writing a book is no easy task. Completing a book when your co-author and friend passes away early in the process, must be a monumental task, this is what Toon Koppelaars achieved with this work.

I ordered this book expecting it to contain examples of using statistics, probability and data mining algorithms as applied to databases. In retrospect, I am not sure why I made that assumption. It is actually about formally specifying database designs using logic and set theory. This book is reviewed and endorsed by C. J. Date and features a foreword by him, which would be high praise for any book on the subject of databases.

It is split into 3 parts and 12 chapters as follows:
  1. Logic: Introduction
  2. Set Theory: Introduction
  3. More Logic
  4. Relations and Functions
  5. Tables and Database States
  6. Tuple, Table, and Database Predicates
  7. Specifying Database Designs
  8. Specifying State Transition Constraints
  9. Data Retrieval
  10. Data Manipulation
  11. Implementing Database Designs in Oracle
  12. Summary and Conclusions

If you’ve studied mathematics (or a tertiary subject with a mathematics element to it) you will most probably be familiar with the sections on set theory and logic. If you have not then they provide an as excellent introduction to these topics that you are likely to find anywhere.

This book makes the following claims and I have made comments against each one:

“This book will help you”:

  • “Become a better database designer. You’ll make fewer mistakes, and your designs will be more flexible in response to changing data needs.” I agree 100% that having a good, if not intuitive, grasp of logic and basic set theory will help you to create better DB schemas.
  • “Use the expressive power of mathematics to precisely specify designs and business rules.” I am not sure how useful this is, and I have a mathematics background. I personally feel that having another notation to express the database design seems to break the DRY (Don’t Repeat Yourself) principle.
  • “Communicate effectively about design using the universal language of mathematics.” I personally do not think this applies unless you are at the top of your game and/or have a theoretical bias and you are communicating with someone similar.
  • “Develop and write complex SQL statements with confidence.” Absolutely agree. I am often surprised at the number of software developers that do not have a thorough grasp of logic.
  • “Avoid pitfalls and problems from common relational bugaboos such as null values and duplicate rows”. Probably, but then 3NF will go a long way to achieving that.

I would be the first to agree that a good, basic mathematics grounding is desirable if you want to confidently design databases that scale well and are modelled correctly.

The mathematics that you learn in this book will certainly put you above the level of understanding of most database professionals. But I am not convinced that alone will enable you to better understand the technology and be able to apply it more effectively. It will help you to avoid data anomalies like redundancy and inconsistency, which are not uncommon problems in the world of databases!

On the whole, I enjoyed reading this book, but I’m not sure if I learnt anything I could immediately put to use when designing and refactoring databases. I did not put a great deal of effort into learning and understanding the formal database specification language described in this book purely because I could not see an immediate benefit when balanced against the effort required to learn a new notation, and I may well have overlooked something crucial that would indeed enable me to create better database designs.

Disclosure: The Perth .NET User Group is a member of the Apress User Group Program. Apress make copies of their books available for user group libraries, and the copy reviewed here was kindly donated by them.