Tag Archives: Software Craftsmanship

Strong Typing to Reduce Defect Count

A long time ago, I was having a discussion with the Director of Development in my office. He was teaching me how we can prevent errors, before they even get to QA, through better coding practices. For example, imagine that you have an integer which represents a high score. Further, imagine that you have an integer that represents loyalty points. Unfortunately, it would be too easy to goof up and pass the high score into a function that was expecting loyalty points. That would compile, and the only way to find the bug would be through Unit Tests, or a QA tester. One easy way to prevent that kind of error is to wrap the high score in a HighScore class, and the loyalty points into a LoyaltyPoints class.

Continue reading Strong Typing to Reduce Defect Count

Writing Solid Code

I often read job descriptions, and they usually say something like “Must have a strong understanding of the principles of SOLID software development.” I feel like I understand SOLID, but on the spot I could NOT recite and provide an example of each. I mean you, Liskov Substitution Principle. I wanted to improve, so I began searching Amazon for a good SOLID book. I happened to run across “Writing Solid Code” by Steve Maguire. Though I was initially fooled by the title, it’s not a book about SOLID principles. This is a book about improving software quality through good programming practices. Writing software was harder 25 years ago, and I figured that he had some strong, timeless lessons. So, through the magic of Prime shipping, I had the book in my hands the next day.

Continue reading Writing Solid Code