Blog

  • Building a Code Review Culture

    Building a Code Review Culture

    I was recently in a conversation about software development and asked about my thoughts on doing a code review. The assumption was that a code review is a good thing. However, there was a question as to how they can be done properly. It may sound like a cliche, but that is an excellent question. There are billions of lines of code written each year, from scripts to full-featured languages. We need to be aware of how to write and produce better code. The review process helps us do that.

    What Is A Code Review?

    We should start with the goals of this practice. Of course, companies vary in their official objectives. Nevertheless, code reviews almost always have the same list of goals.

    • Reduce bugs
    • Improve Quality
    • Verify Adherence to Standards
    • Cross-training/Leverage Expertise

    There are nuances and details to each of these items. However, a process that addresses these is off to an excellent start. We should not do anything simply to be busy or conform to a norm. We want to have concrete value in our work, and the above items give us that.

    Developer peers typically do a code review. There can be any number of participants, and it may be direct and in-person or performed off-line. There are tools to assist in a review, or “paper and pencil” approaches might be used. The highest level description of a code review is a person (or persons) walking through source code with an eye for improvement or errors. We can look to the above objectives to help us flesh out this process to make it more effective.

    Reduce Bugs

    It is frustrating to developers, but many bugs are easy to detect. There are typos and simple logic flaws we miss while cranking out code. The second set of eyes can often help us quickly spot these issues and address them. A code review that aims to assess logic and scan for inconstancies can help us squash bugs sooner and faster. This is not a process without cost. It takes an investment of time to review code and provide feedback. However, it is worth the effort. We gain in quality but also productivity as we work together to implement solutions that are peer-reviewed. The things I am most attuned to are not the same as your experience. That means a few minutes of your time may easily determine bugs that take me hours to track down. Minutes for hours is always a worthwhile trade.

    Improve Quality

    Quality and bugs are related but not the same. You can write low-quality code that is bug-free. Yes, I mean that. There is a lot that goes into quality. It has to be correct, maintainable, scalable, stable, and more. A code review helps bring the team to the same page. The programming standards can be reviewed and feedback given on specific code rather than just functionality. That leads to better developers, tighter code, and a consistent style throughout the application that makes it much easier to maintain. You get a reward today and in the future for going through this process.

    Adherence To Standards

    Every organization needs a standards cop. There is value in everyone on the team rowing in the same direction. This objective is partially addressed by standards. While there are automation tools that enforce these rules, not everything can be reduced to a rule. The code review process allows the team to go over processes and standards with an eye towards to enforcing and improving them. It is easy to take a short cut in a rush to solve a problem or forget to “clean up” a quick code snippet. That is where this process comes in. The author has someone to follow behind and provide accountability for the work before it is committed up the chain.

    Cross Training

    Another benefit of going through this effort is cross-training. Team members are at least exposed to areas they may otherwise never see. There is always a cost to cross-training in terms of time. However, a code review adds value immediately while still moving forward the breadth of experience in the team. Members that are completely ignorant of a section of the solution can gain insight and even familiarity through this process. They not only see code, they are brought into the discussion as features are created, bugs found, and decisions made. They also have a context to work with in terms of code that has been reviewed in the past.

    A Worthy Investment

    My goal through all of this is to show that there is value in doing code reviews. However, it is not something you can magically start and immediately do fully. There is an art to being able to walk through code and provide insight. That takes time and experience. Therefore, the best time to start this process was last year, but the second best time is now. Get out there and bring the team into your coding.

  • The Mid-Year Review

    The Mid-Year Review

    A New Year always includes a flood of articles on planning and assessing for the year gone by and the one ahead. However, annual planning is not enough. That is why a mid-year review and adjustments are valuable. In particular, we need to adjust during the journey rather than wait until the end. They should also be much less investment than year-end as your course is set. It just might need some modification.

    Where Are We

    The middle of the year is a good point to see how you are doing. You should be about halfway through your goals or progress set in January. If you are ahead of schedule, then keep forging on. When you are off-track, then review options for getting back on track or even adjusting goals. Six months is a lot of time for a correction to “bake in” and turn a loss into a win. The modern business world moves fast. Your mid-year review may point to goals that need to change. A new product idea may appear to be a better direction to take, or the window of opportunity may have passed for a flagship goal of the year. Do not throw good resources after bad. If it is time to call it quits, then do so and move on.

    What Works, What Needs Change

    Another benefit of assessing progress at this point is that you should have a solid track record of success or challenges so far. Your adjustments made in January have now been in place long enough to evaluate them. The processes and tasks that have not paid off can be replaced with options that will hopefully serve you better. You might also be able to double down on the things that have worked well. Consider things like A-B testing and that you might know have a clear direction with either A or B. At this point, the evaluation period can end. There is no need to keep checking the score once a winner has been decided.

    Looking Ahead

    It never hurts to start to position yourself for the next race or objective. You can wait until November or December to start planning for the next year, or you can start today. There are often things you can do to help inform decisions to be made down the road. First, consider what sort of options you want to assess for the next year. Then keep an eye out for articles or other ways to get a jump start on assessing whether an option is worthwhile or if it is better to pass. When you put something on your mental radar and let it sit, you can often end up with a lot of material for that decision almost for free. You will find that you pay more attention to passing articles and discussions than you would otherwise.

    Adjust and Execute After A Mid-Year Review

    Once you have assessed where you are and where you want to be, it is time to make adjustments. These can be as little and simple as changing metrics or reporting up to scrapping a plan and going back to the drawing board. Do not be afraid to make big changes at this point. There is nothing to be gained by dragging out a losing cause. No one likes bad news. However, when you take the big step of re-assessing your goals and plans, you can properly set expectations for the remainder of the year. We all have seen situations where the goal line is adjusted multiple times in minor ways. These “corrections” can lead to frustration and wasted resources. A mid-year review is a perfect occasion to take a larger step and make a more significant course correction.

    The good news in all of this is that you have enough time to make these changes and still evaluate them at year-end. Our mid-year review and adjustments provide an opportunity to cut losses and start forward on a path to success six months sooner. However, that does require us to take a hard look at where we are and how we got here with an eye towards improvement. As with annual planning and review, look to change as a path to improvement rather than merely accepting failure.

  • Finding A Solution With Limited Resources

    Finding A Solution With Limited Resources

    We all have times and projects that are beyond the available resources.  It is a goal too big or a window too small for our limited resources.  In the world of business, this may be too many tasks and not enough team members.  In our personal lives, it may be a day full of too many tasks and not enough hours.  There are ways to work through these situations.  Fortunately, we can even get a "win" at times by embracing some of these common ways to overcome shortcomings.  These include a lack of resources or a lack of skills.

     Face The Reality of Limited Resources

    The often largest hurdle is to admit you have limited resources for your objectives.  It can be tempting to try to jam a square peg in a round hole.  That includes trying to achieve a goal even with limited resources.  This approach is not different from sticking your fingers in your years and loudly saying "I can't hear you" to avoid bad news.  It is not beneficial and amounts to ignoring the problem.  I have never seen this as a valid approach.  It blocks us from taking productive actions like those that follow.

    Some try to aim for the stars with the idea of at least reaching the moon.  However, it seems like too often, you end up flat on your face.  There has to be at least a plan for hitting that lesser (more reasonable) target.  This approach also helps avoid spending time on tasks or features that end up being unfinished or of lower quality.  

    Adjust Scope

    The easiest way to match resources to a goal is to change the goal.  That may mean accepting a solution that is only 80%.  It may mean waiting longer or spending more money.  Any of these changes may be acceptable.  However, make the hard decisions and adjust your goals.  It allows the team to focus on the new goal and ignore things that do not contribute.  In many projects, this decision can remove tasks from the board and free up time to get to a high-quality and acceptable solution.  In some cases, this will equate to highly marketable versions 1 and 2 of a product instead of a late version 1.

    Sooner Rather Than Later

    The sooner you accept that changes are needed, the better.  I have seen projects go until the figurative final hour before trying to make adjustments.  Many of those projects would have been delivered on time if only they had adjusted the course sooner.  The more time you have left in the journey, the less course correction is required.  In software, this can be a substantial factor.  Early decisions can free up resources in every area, from design and analysis through to testing and deployment.  An excellent example is the choice of platforms.  I have seen projects drop a native mobile requirement late in the game that literally could have reduced the overall cost and timeframe by half if done sooner.

    Wait For The Estimates And Accept Them

    Estimation can be time-consuming.  Nevertheless, it is precious.  Good estimates can warn you of issues in scope or timing long before they become a true obstacle.  Take the time to estimate tasks and effort.  Then, accept those estimates.  When you have estimates that put you beyond a target, adjust the target, do not push back on the estimates.  This process will create a bad environment where people provide what you want to hear instead of reality.  That can lead to the emperor having no clothes, and you are the emperor in that case.

    Working Smarter With Limited Resources

    It is almost a cliche to work smarter, not harder.  Nevertheless, there is a lot of value in this approach when you have limited resources.  We often have extra things that are done as part of a project.  These tasks include estimation, planning, administration, polishing, and other items that may not be needed.  While they may have value, they may slow you down.  We can see this in race cars.  They strip down the vehicle to only what is necessary for the race.  When you lack the resources to do it perfectly, find the ways you can cut to the core.  

    A project that requires people to give up weekends or work long weeks of overtime should also reduce scope and clutter.  That means every task and the scheduled meeting should contribute to the goal.  The time for checking off a box or making someone feel comfortable was probably passed a while back.  That includes up to a CEO that wants to check in on progress all the time.  When those check-ins start to take the team away from the goals, be honest and find a less intrusive way to keep them informed.  Likewise, if something has been going bad or taking you off track (including specific resources), then do not be afraid to make adjustments.  A bad trend is likely to continue until you make a change.

    The Shortest Path

    The bottom line is that you need to focus on the goal.  Make sure you have a clear picture of what is necessary and what is not.  Then plot the shortest route to get to the end.  Drop everything not completely necessary first.  Once the simplest path (and tasks) is defined, you can add back in things that are likely to keep you on track.  When you do this, cut deep.  It is easier and more effective to add something back in later if time permits than cut something out down the road.