Digital thoughts from a seasoned programmer About

Stop Wasting Time

By Matt Raffel on January 20, 2025


I often feel that while engineering practices like unit testing, linter rules, pull requests, and code reviews are well-intentioned, we sometimes get overly fixated on adhering to the rules rather than focusing on their underlying purpose. This can lead to a significant waste of time, which is arguably the most expensive resource in software engineering.

The 300-Line Tyranny

I found myself in a situation where a pull request was blocked by a linter rule that limited files to 300 lines. The file in question--all 314 lines of it--was a single controller for a specific screen element. To comply, I spent hours refactoring, tweaking comments, and even creating a separate class (which was only used by this single controller). Was this effort truly worthwhile? Were the comments and logic truly better off being truncated just to satisfy a seemingly arbitrary line limit?  You'd have to convince me.

The Spurious Test Saga

We faced a recurring issue with intermittent failures in our unit and integration tests. These failures repeatedly blocked pull requests, causing major delays. Despite our best efforts to fix them, the tests continued to fail sporadically. While these failures might have hinted at underlying code issues, the system was functioning correctly in production. Proposing to remove these tests sparked heated debates.  This was never resolved and continued to be a burden and cost to engineering.

The Production Data Predicament

Stakeholders required the use of production data for sign-off due to the time-sensitive nature of the information and the lack of for audit trails to build this data made disparities in test and production hard to verify. I submitted a pull request with some existing, albeit complex, code. A reviewer, unfamiliar with the full context, deemed the code overly complicated. And even though this code was already in production, it led to not only delays in refactoring but also in obtaining stakeholder approval. The net result? A month of lost productivity.

The Value of Processes and Tools

It's crucial to understand that processes and tools like unit tests and code reviews serve valuable purposes in maintaining code quality and reliability. However, an excessive focus on strict adherence to rules can inadvertently become counterproductive, leading to significant time wastage.

Comments

If you'd like to comment on this post, please reach out to me through the contact page .
The bikini bottom atoll is sinking. Reload 🗙
An error has occurred. This application may no longer respond until reloaded. Reload 🗙