If you work in the field of software development, guidelines, best practices, and instructions are the words you should be familiar with and have been adhering to since the very beginning of your career. These together act as a compass for developers navigating complex projects. However, strictly adhering to these without applying practical reasoning can sometimes lead to unexpected pitfalls. We see so many of such instances every day around us that somewhere it felt like a necessity to pen down the importance of following instructions properly while employing common sense to make sound decisions.

The Perils of Blindly Following Instructions

Imagine a developer named John tasked with optimising a web application’s performance. The engineering guidelines recommend caching as a standard method for performance optimisation. Eager to make improvements, John implements aggressive caching throughout the application. Initially, this seems to work wonders for speed. However, soon users begin reporting that their data isn’t updating correctly. By applying caching indiscriminately, John overlooked dynamic content that shouldn’t be cached, leading to stale data being presented to users.

This scenario exemplifies how following instructions without considering the broader context can create more problems than solutions. John followed the guideline but didn’t apply common sense to assess where caching was appropriate.

These examples emphasise that while guidelines are crucial, they are not a substitute for critical thinking. Developers should understand the reasoning behind instructions and consider whether they fit the specific situation. Blind adherence can stifle innovation and lead to inefficient or even faulty outcomes.

Evidence from Daily Developer Behaviour

Overcomplicating Solutions:

Developers might implement complex design patterns simply because they are considered best practices, even when a simpler approach would suffice. This can make the codebase unnecessarily complicated and harder to maintain.

Imagine a developer named Sam who is working on a small utility application that requires accessing a configuration setting stored in a file. The application is simple, and the configuration doesn’t change at runtime. Instead of reading the configuration file once and storing the necessary values in a variable or a simple class, Sam decides to implement the Singleton design pattern for the configuration manager.

Sam creates a ConfigurationManager class with private constructors, static access methods, and ensures thread safety with locks. The class includes elaborate code to prevent multiple instances and handles serialization concerns, even though the application doesn’t require such complexity.

In this example, Sam applied the Singleton pattern because it’s a well-known best practice for scenarios where a single instance is desired. However, applying it without considering the application’s context led to unnecessary complexity. A simpler solution would have sufficed, making the codebase cleaner and more maintainable.

Ignoring Project Specifics:

A team might use a technology stack recommended in a popular tutorial without considering whether it’s the best fit for their project’s requirements, leading to scalability or compatibility issues down the line.

This is often observed while a new team takes over a legacy solution. In order to introduce modern tech stack, they often go overboard and introduce things in the stack that might create maintenance overhead. In many cases the older tech stack is retained and a new component is added to do similar things in newer components. Thus creating a dependency hell that becomes incredibly hard to mitigate.

Misapplying Security Measures:

Implementing security protocols without understanding their purpose can leave vulnerabilities. For example, using solid encryption algorithms without proper key management renders the security measures ineffective.

One very recent example that I have come across. A team have done really detailed implementation of a well known cryptographic algorithm without considering the key rotation. As a result when a key pair was compromised, the mobile app had to be pulled down from playstore and business was halted for some days before this was finally fixed.

The Role of Common Sense

It is important to know the role of common sense in everyday work. This is not some Common sense in software development involves:

Contextual Evaluation

Assessing whether an instruction or best practice applies to the current project’s context.

Critical Analysis

Questioning and understanding the ‘why’ behind guidelines to make informed decisions.

Adaptability

Being willing to deviate from standard practices when a better solution presents itself.

Implementing a Balanced Approach

By now we have established that following guidelines blindly will lead to pitfalls that could have been avoided by mixing the guidelines with common sense. Now, how do we implement a balanced approach?

Understand the Principles

Don’t just follow instructions — understand the principles behind them. This knowledge allows you to adapt guidelines to fit your specific needs.

In many cases, the guidelines might have been written a very long time ago and need improvement themselves. Before sticking to the guidelines understand the rationale behind them and ask questions (my next point) to really understand them well.

Ask Questions

If an instruction doesn’t seem to fit (in your opinion), don’t hesitate to question it. Discuss with your team or do additional research.

Stay Updated

The tech industry evolves rapidly. What was a best practice yesterday might be outdated today. Continuous learning is key. Keep learning and keep modifying the best practices to stay relevant.

Think Critically

Evaluate the potential impact of following a guideline in your specific scenario. Consider possible side effects or alternative approaches.

Collaborate

Leverage the collective wisdom of your team. Peer reviews and discussions can provide new insights and catch potential issues early.

Bringing Common Sense into Daily Practice

Code Reviews with a Purpose

Use code reviews not just to check for compliance with standards but to encourage discussions about the best approach for a given problem.

Flexible Planning

While project plans are essential, be prepared to adapt as new information or challenges emerge.

User-Centered Design

Keep the end-user in mind. Sometimes, adhering strictly to technical guidelines can lead to a poor user experience.

Conclusion

The balance between following instructions and applying common sense is a delicate but essential part of software development. While guidelines provide a valuable framework, they should not replace critical thinking. Developers must use their judgment to determine the best course of action for each unique situation.

By blending adherence to best practices with practical reasoning, developers can create more effective, efficient, and innovative solutions. In a field that thrives on problem-solving and creativity, common sense is not just beneficial — it’s indispensable.

So, the next time you’re faced with a development challenge, remember: instructions are a guide, not a rulebook. Trust your knowledge, question thoughtfully, and let common sense lead the way.

Happy coding, and may your decisions be as sound as your code is clean!

 

Originally published at https://medium.com on September 18, 2024.

Swagata Acharyya

Swagata Acharyya

Swagata is a passionate Solution Architect with rich experience of over 16 years. He has been instrumental in designing and delivering innovative mobile solutions across diverse sectors like Fintech, Cabin Innovation in aviation, Entertainment...