Accelerate your software engineering career by deleting code

While you were writing some new shiny features today, the following happened:

  • Someone accidentally disabled a feature flag gating the most important product feature that shipped years ago
  • Someone spent a day fixing tests not realizing the code being tested is only executed by these tests
  • Someone missed a deadline because the build system was building long forgotten libraries instead of the code they committed to ship

The common denominator for all these cases – dead code.

Aggressively cleaning code that is no longer needed or used can, and will make your team more effective because it reduces the overall complexity of the codebase. This, in turn, unlocks a lot of benefits:

  • bugs and mistakes are easier to avoid
  • new features can be delivered faster
  • less time is spent on (unneeded) maintenance

Deprecating rarely used features takes it to the next level.

Try it, and you may turn your team into a team of the proverbial “10x engineers”.

Tab Garbage Collector

I am very good at opening new Chrome tabs but not as great at closing them. Very often, I open a tab and forget about it and to open a new one. As a result, I always end up with a lot of duplicate tabs that only take my precious tab space. At the same time I feel anxious whenever I think about closing a tabs. To “solve” my problem I created a simple Chrome extension – Tab Garbage Collector – that finds duplicate tabs and let’s me close them with just one click. I know that this is not only my problem so I published my extension in the Chrome Web Store so that anyone can use it.

Here is a short video showing the extension in action

If you are interested what’s under the hood, the code is available on github.

Accelerate your software engineering career by reviewing code

Reviewing code is often treated as a chore. This is sad because reviewing code is a great opportunity!

  • Code reviews help find bugs early
    The earlier a bug is found the smaller the damage it can cause, and the cheaper it is to fix. Code reviews allow catching bugs very early in the process.
  • Code reviews allow influencing the design
    Suboptimal design choices are hard to change once submitted. Code reviews make it possible to identify them early and discuss alternative solutions that could make the code simpler, more robust and easier to work with.
  • Code reviews help the team achieve its goals
    Each diff contributes to achieving some goal. Reviewing code unblocks the team to move towards this goal.
  • Code reviews are a great learning opportunity
    Diffs contain a wealth of knowledge. Whether it is an interesting language feature used by the author or an innovative idea proposed by a fellow reviewer, there is always something new to learn.
  • Code reviews give a chance to foster knowledge
    Just as you can learn from others through diffs, others can learn from you. By suggesting alternative approaches, highlighting trade-offs or explaining language intricacies you can help other engineers grow.

But wait, there is more! In addition to all benefits listed above you can also be recognized for reviewing code. When I worked at Amazon my code reviews won me an award for demonstrating the “Insist on the Highest Standards” leadership principle and were one of the factors supporting my promotion.

Accelerate your software engineering career by sending small diffs

Every software developer gets carried away once in a while. There is this new cool, top requested feature and we want to code it quickly, so we disappear somewhere and, after a few weeks, we drop this huge diff (a.k.a. PR, CR) like a bomb. We are so proud of our work! Somehow, our team members do not share our level of excitement. Why is that?

Well, it turns out that huge diffs create a number of problems that make lives of both the author and his team harder:

  1. Getting huge diffs reviewed is challenging
    Finding someone willing to review a huge diff is difficult. Once this person is found, the progress depends on them finding a lot of time to properly review the changes.
    Occasionally, a huge diff draws attention from multiple reviewers leaving tens of conflicting comments. Each new iteration addressing these comments only sparks more comments.
  2. Keeping huge diffs up-to-date is hard
    While a huge diff is being iterated on smaller diffs are merged daily. This may result in merge conflicts which take time to resolve, create risk of introducing bugs due to bad merges, and make it harder to understand what changed between iterations.
  3. Huge diffs rarely receive good feedback
    Understanding of a huge diff is hard and time consuming. Reviewers often focus on less relevant but easier to understand details. Sometimes they give up and just rubber stamp the diff without leaving any useful feedback. In either case, obvious issues can easily sneak into the product.
  4. Huge diffs make it hard to pivot
    Sometimes, someone finds an issue that forces changing direction. In case of a huge diff it means a lot of time was spent on writing code that now needs to be rewritten or thrown away.
  5. Merging huge diffs may have significant negative impact
    When a huge diff is finally merged, it often wreaks havoc across the team. Many ongoing changes have to be redone, the number of reported issues increases significantly, dashboards and alerts get broken, etc.

The alternative to huge diffs is splitting the work to smaller, more manageable chunks. Each chunk should be a logically complete piece of functionality that can be independently merged and brings the feature closer to completion. It may feel like more work but it is a much more effective approach:

  • code reviews are faster as small diffs take less time to review
  • different diffs can be reviewed by different people – there is no longer a bottleneck of a single reviewer
  • smaller diffs are easier to understand so they get better feedback
  • it is possible to work on the next diff while having one in review
  • changes are localized so the risk of merge conflicts is reduced
  • course correction, if necessary, is easier because there is not much code impacted

Getting used to splitting the work to smaller chunks can be hard at the beginning but once you get used to it, it will become natural and your productivity will soar!

Accelerate your software engineering career by understanding adjacent layers.

As a developer you are always between something. If you work on UI, you are between the user and the rest of your application. If you work on web services or APIs, you are between the web framework and a database, a library, or another service. Your executable code is between the compiler and the runtime (JVM/CLR) or CPU.

While it’s possible to work just in your area, ignoring what’s above and below you is not a good long-term strategy. Knowing at least a little about adjacent layers is invaluable because it:

  • makes debugging “weird” issues easier
  • can help prevent mistakes made due to incorrect assumptions
  • allows choosing more optimal design choices

How can you learn about adjacent layers? Here are a few ideas:

  • If you are using a popular framework, a library, or a product like a database there should already be a lot of documentation readily available
  • In case of open-source projects you can simply check out the code
  • For libraries or services created in-house you can talk to the team who built them or read the code
  • You can also look at the code for JavaScript (or TypeScript) libraries because they ship as code. Minification and uglification can make it challenging
  • If you don’t have access to code and you’re working with languages like C# or Java, you can use decompilers that do a decent job generating code from the IL/bytecode
  • Your last resort is looking at or debugging the assembly, but this is hard in general and your mileage may vary.

Once you get a good grasp of your adjacent layers you can take it further and understand layers your code doesn’t directly interact with. Keep doing this and soon you will be one of only few people who understands the entire stack.