The number one worst practice I see consistently in object-oriented software development is writing procedural code. Even object-oriented programming projects contain code that is highly procedural. You’ve probably seen code like this yourself where it’s basically a series of steps that prescriptively describe a process that is then wrapped within a class. This is really …
Continue reading “User Stories Support Object-Oriented Development”
Read MoreStories should be as small as possible while still providing some value to the user. Usually, we strive to create the smallest increment of value possible but this is sometimes not as straightforward as it may seem. Sometimes we write stories with the intention to build upon them later or combine pieces of common stories …
Continue reading “How Small should a Story Be?”
Read MorePolymorphism is a big word for an important technique in object-oriented programming to help make code extendable. Rather than expressing business rules as conditional statements in code, we move them into factories and use them to instantiate objects that do the actions we want to take. We need to know different things when we create …
Continue reading “Polymorphism”
Read MoreOf all the software developer practices I teach, the one I get the most resistance from managers is pair programming. They tell me they have too much work for their team to do and if they paired then their developers’ throughput would be cut in half. There is a naïve assumption in that statement. The …
Continue reading “Pair Programing Paradoxes”
Read MoreThere are patterns, things that developers do when writing code that support testability of code and there are anti-patterns, which are things that developers do that lead to writing code that is difficult to test. As a developer, I’ve found it helpful to become aware of some of these testability patterns and anti-patterns that I …
Continue reading “Drive to Testability”
Read MorePerhaps the most important yet easiest to implement of all the software development practices in Agile is continuous integration. Continuous integration is simply creating an infrastructure where the code that is being built can immediately be integrated into a project. One of the biggest challenges when writing software is the dependency relationship between the code …
Continue reading “The Importance of Continuous Integration”
Read MoreSoftware development has undergone many revolutions over the last few decades. The way we build software today is fundamentally different than the way we did just a few years ago. Our industry is maturing and we are beginning to pay attention to the quality of our work. No longer is just fulfilling the specification enough …
Continue reading “The Importance of Technical Practices (Again)”
Read MoreI finished my “Seven Strategies” series of 72 blog posts with seven strategies for implementing each of the nine practices from my book, Beyond Legacy Code: Nine Practices to Extend the Life (and Value) of Your Software. These posts are filled with practical advice for implementing the nine core practices from Scrum, Extreme Programming, and …
Continue reading “Summary of Seven Strategies Series”
Read MoreOne of the things that I was not expecting when I started refactoring other people’s code was that I started to see improvements in the way I wrote my own code. I didn’t make those same mistakes. Refactoring other people’s code has taught me a great deal about things to do and things not to …
Continue reading “Refactor to Learn What Not to Do”
Read MoreOf course, the best time to refactor code is while it’s fresh in your mind, right after having worked with it. Once I get a feature to work, I go back and think about how I can make the code easier to understand. I’ve done this so often that it’s natural for me, almost of …
Continue reading “Refactor to Clean Up Before Moving On”
Read MoreOne of the reasons that I’m such a proponent of doing emergent design or just-in-time design, is that this is how we learn a system and this is typically how a system needs to be built. It’s fallacious to believe that you can easily envision every aspect of a complex system and come up with …
Continue reading “Refactor to Redesign When You Know More”
Read MoreWe should be refactoring the code we write and all the code that we encounter all the time. Making little improvements to code should be just something that developers do without even thinking about it. I find that many of the anti-patterns the developers engage in when writing code are easy to spot and after …
Continue reading “Refactor to Clean Up as You Go”
Read MoreThe so-called safe refactorings are a subset of the refactorings from Martin Fowler’s book, Refactoring: Changing the Design of Existing Code. We call them safe because they require only straightforward changes to code that can be automated and proven to be correct with no unintentional side-effects. Safe refactorings are refactorings like Rename Method that lets …
Continue reading “Refactor to Retrofit Tests in Legacy Code”
Read MoreAnother strategy to help you justify refactoring is to do it in order to make small improvements in an existing system. Don’t try to bite off the whole Apple at one time. Really bad legacy code got that way over long periods of time and in my experience, a similar, gradual approach can be good …
Continue reading “Refactor to Make Small Improvements”
Read MoreOne of the best opportunities to refactor code is when you’re starting to get to know it. This not only helps improve the code but it also improves your understanding of the code and helps everyone else who touches the code in the future. There are many kinds of refactorings that one can do to …
Continue reading “Refactor to Learn an Existing System”
Read MoreHaving put the words “legacy code” in the title of my book, people often confuse my book with Michael Feathers’ book, Working Effectively with Legacy Code. On one hand, it’s great to be in such esteemed company. I love Michael’s book and I refer to it often. It’s full of great techniques for taming legacy …
Continue reading “Why Practice 9: Refactor Legacy Code”
Read MoreAs you can see from my last seven blog posts, doing emergent design is not for beginners. Doing emergent design is an advanced development practice. But it’s not enough to know about good development principles and practices. It’s not enough to know about design patterns. We have to use them. We have to apply them. …
Continue reading “Practice Good Development Habits”
Read MoreOne of the most important characteristics that I find senior developers have is the ability to change their minds and let go of an existing design when it no longer serves its purpose. What I find time and time again is that developers become attached to the current design even in the face of changing …
Continue reading “Be Merciless”
Read MoreI believe in the Agile Manifesto. I know most of the original authors and they know that I think they’re pretty cool. They got so much right in such a short amount of space and that’s very admirable. But there’s one thing that I think they kind of missed the mark on, so I’m going …
Continue reading “Focus on Code Quality”
Read MoreRefactoring code is not just changing the design of code without changing its external behavior, it’s also doing it in small, safe steps that are repeatable. This is what elevates refactoring to a discipline that we can talk about and create best practices around rather than just willy-nilly ways of changing code. It was Martin …
Continue reading “Understand Refactoring”
Read MoreAnother important aspect of doing emergent design is doing it safely and that means doing it while code is under test. But not just any tests, we have to write behavioral tests that don’t break when we refactor our code to emerge our designs. These are precisely the kind of tests that I’ve been talking …
Continue reading “Understand Test-Driven Development”
Read MoreDoing emergent design is an advanced practice that requires knowledge of a great many skills. One key skill that all professional software developers should acquire as they journey towards mastery is a deep understanding of design patterns, both in concept and in terms of the 23 design patterns called out by the Gang of Four …
Continue reading “Understand Design Patterns”
Read More