You adopted AI but the delivery timeline didn’t change. Our paper explains why →
September 1, 2020

Do not Optimize Prematurely

By Sapan Parikh

Once again, you would think that the software development community has moved past this point, but I still get many teammates who want to “save memory” using HashMaps instead of POJOs. I am not too sure how efficient HashMaps are compared to POJOs, but I am sure of how they can become a maintenance nightmare if we start using maps wherever we could use POJO.

In hindsight, it now seems foolish, but I have been guilty of committing crimes like sprinkling static variables, singletons, and data structures like maps instead of more compiler-friendly data structures. All this is because either I had some misconception about how performance optimization works or an obscure scenario in my mind like “what will happen when 2,13,00093 users access my piece of code in parallel.”

Between a speculative performance issue that you may or may not encounter and the use of clean code, clean code should always win. If your code is clean, it will be easy to find it and fix it when a performance issue arises.

About the Author

Sapan Parikh

Co-founder and Software Craftsperson at Incubyte

A tech evangelist and mentor, Sapan has been fuelled by two things in his 15+ year professional career; coffee and his love of designing self-motivated, high-performing and passionate software engineering teams. Being a software craftsperson at heart, he has created and coached teams of over 500 software developers spread across the US and India with the sole objective of forging exceptional software products with an unfettered focus on quality.

Table of Contents

    Share this resource

    Latest Articles