Total WTF moment whilst reading Clean Code

I’ve just spent a useful and enjoyable day finally getting around to reading Clean Code, definitely a book to come back to time and again for reference, etc. However, given the subject matter, the book contains I was amazed to find in the section about “magic numbers” a statement that “some constants are so easy to recognise that they don’t always need a named constant”.  Two of the examples given are the number of feet per mile and the number of work hours per day.   I’m not sure how many people that work with imperial units could easily state how many feet are in a mile.  If you are more used to using metric units then that figure has next to no meaning what so ever.  And at least in the UK working hours vary depending upon the industry, company and even department that you work in.  Whilst it doesn’t detract from the content of the book I’m not sure those statements should have got past the proofreading/draft review stage.

Similar Posts

  • My New Blog

    I’ve been hosting my blog on Blogger for the past 10 years. For the past couple of years, I’ve been looking at rebooting my blog, trying to decide whether to stick with Blogger, write my own blog platform (like all developers at some point) or move onto WordPress. I’ve never needed to set up a…

  • Review of 2013

    2013 certainly didn’t turn out as planned, the less said about the first half of the year the better; so moving on (which I did!) In the second half of the year I joined a company which has managed to get me excited about and enjoying programming again! It has been an insanely busy 7…

  • Project Euler #24

    I’m trying to start up on project Euler again, one thing I do like is that it highlights how poor some of my maths knowledge actually is. Neither school or college covered many of these algorithms; which is a bit of a surprise given that I did a four-year mechanical apprenticeship with applied mathematics…..still never…

  • Review of 2012

    2012 has been a full-on year with lots of change. I started the year in my previous role, preparing for a transition into a newly created role of “Solution Architect”; moving away from both day to day coding and purely concentrating on .NET applications/systems. It sounded a really interesting challenge but another opportunity presented itself…

Leave a Reply

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