I first read Stephen Covey’s book, The 7 Habits of Highly Effective People, in my early twenties. It’s a great, thought-provoking book that tries to simplify life’s biggest questions and challenges into a handful of practices and principles. Could the application of these habits make us more productive programmers? This is a question I thought might be worth exploring.
For each of the habits I will provide a brief summary, in order to develop the idea from a programming point of view. These summaries do not do the book justice. If you’re interested in learning more about the 7 habits, buy the book!
HABIT 1: BE PROACTIVE
Covey’s first habit is about proactivity – taking the initiative, not letting circumstances and conditions define who you are and what you do. We can be proactive by trying to make things happen at work. If you want your team to adopt agile practices, TDD or continuous integration, have that conversation with your boss. Make a plan and take the first step. If you know that your technical debt is growing, put aside time to review and refactor. Read a recommended book. Start a blog. The most successful programmers are those who are proactive, they don’t succumb to boredom in their career, they actively choose a direction and move forwards.
HABIT 2: BEGIN WITH THE END IN MIND
Beginning with the end in mind is understanding where we want to go, or as Covey puts it, ensuring our ladder is up against the right wall before climbing it. At work, our ladder needs to be leading us towards a happy customer. That customer may be a paying client, your boss, the end-user, or most probably some combination of all of these. Typically the ‘end’ to keep in mind is defined by our customer requirements, but also by our knowledge that systems need to be easy to maintain in the long run. If we implement a quick and dirty solution, will we, or someone else, come to regret this in the future?
We also need to be mindful in order to avoid being distracted by trivial things. While it may be interesting to spend six hours animating a div, is this activity really in the best interests of our customer?
The whole concept of TDD is built around the idea of beginning with the end in mind. We don’t just start writing code blindly, we begin by defining exactly what the code needs to do before actually writing the code. In Code Complete, Steve McConnell dedicates an entire chapter to the idea of ‘measure twice, cut once’, which teaches us to spend adequate time preparing for our work before we actually do it. I once read on a forum that a good programmer spends 90% of their time thinking and 10% of their time coding. All of these principles point to not getting caught up in the thrill of coding at the expense of customer requirements or a highly cohesive and loosely coupled design.
HABIT 3: PUT FIRST THINGS FIRST
Habit 3 encourages us to dedicate enough time to those things which are important to us. In particular we shouldn’t neglect tasks or goals which are important but not urgent, or as Covey defines them ‘quadrant 2’ tasks. In programming terms, these might include getting our code reviewed, adding unit tests, refactoring or paying off technical debt. How can we ensure that these things get done? Some form of time management is essential for this, whether it is the simple Pomodoro Technique, the more complex Getting Things Done system or Covey’s own ‘First Things First’ approach. I broadly favour the Pomodoro Technique, but the details of my own time management system evolve over time. The point is that if we don’t plan and include quadrant 2 tasks in our plans, we may find ourselves spending a lot of time just firefighting without getting any closer to achieving our long-term goals.
HABIT 4: THINK WIN-WIN
The last four habits are less about self-management and more about our interpersonal relationships. The think win-win habit directs us towards solutions which benefit all parties, including ourselves. An example of this is the idea of making your boss look good, as suggested in Fire Your Boss. If you can make your boss look good, its good for your career, its good for your boss’s career, and it’s probably good for the business. If a colleague is bad at unit testing, then helping them out might also help the project which in turn helps you. Scrum is a great system for benefitting all parties. The daily standup meeting allows us to share problems and solutions, as well as preventing us from going down the wrong path and keeping our customer up to date. By striving for win-win situations we will ultimately cultivate a more rewarding, productive and successful career.
HABIT 5: SEEK FIRST TO UNDERSTAND, THEN TO BE UNDERSTOOD
We are definitely going to encounter situations in work and in life where we see things differently to someone else. Habit 5 suggests that before trying to make another person understand our point of view, we need to try to understand theirs. The boss who wants you to work late has their reasons and is probably not just trying to make your life a misery. The teammate who refuses to check their code in regularly may have doubts about its quality, which might demand a different response to your instinctive one. But probably the most important application of this habit is in understanding our customers and their requirements. Frequently we make the false assumption that the customer actually knows what they want, when in fact they need our help in exploring and discovering their requirements. This is why it is so important to spend adequate time in the requirements capture phase of a project. Again – ‘measure twice, cut once’. We could implement a brilliant design and a flawless testing phase, but if our requirements are wrong then the project is a failure.
HABIT 6: SYNERGIZE
Well-run, agile teams continually exercise the principles of synergy defined by habit 6. Covey defines this habit as follows:
What is synergy? Simply defined, it means that the whole is greater than the sum of its parts.
The agile methodology encourages us to work in tandem with our teammates, our managers and our customers. We begin each sprint by defining, together, what we want to achieve and how we are going to achieve it. At the end of each sprint we look back and discover how we can improve our processes.
Pair programming, at its purest, is a practice I have limited experience with, but even having a colleague sit next to you while you show them a problem is exercising this habit.
Code reviews bring two programmers together resulting in a product which is probably better than either could have produced alone.
As programmers it can be tempting to cut ourselves off from the rest of the world and become totally engrossed with our code. We need to dare to work closely with others in order to get better results.
HABIT 7: SHARPEN THE SAW
The last of Covey’s habits emphasises the importance of looking after and developing ourselves. It is the principle of ‘self-renewal’. For me, examples of this are regular exercise, taking at least one holiday every year, watching football with friends, and spending time reading about programming and listening to podcasts. As rewarding as programming endeavours can be, this habit also requires us to spend time away from programming, with people who are important to us and doing things which we find relaxing. In this way we can ensure that we will never burn out, and that when we do work we are as productive as we can possibly be.
The 7 habits might be seen as somewhat idealistic. In high pressure working environments and busy lives, it can be difficult to focus on such abstract concepts. However, by aspiring to work and live in a certain way, I think we can find ourselves naturally developing ourselves even when the pressure is on. Whilst we need to remember that nobody is perfect, and neither is any set of principles or habits, it can often be fun and rewarding to give these things a try. After all, what have we got to lose?