But What About Performance and Size?
Some of you may be concerned over the extra functions and function calls that are the result of refactoring, maybe for speed, maybe for memory size. You may have such constrained environments that you have to squeeze every last bit of space and performance out of it. My advice, as well as that of many others, is to first structure code for clarity and optimize only when measurements support the optimizations.
Make It Work, Then Right, Then Fast
In Extreme Programming Explained [Bec00], Kent Beck promotes this motto:
-
Make it work.
-
Make it right.
-
Make it fast.
What would you rather do, debug some optimized tricky code or optimize some clean and well-factored code? It’s not a trick question. Making clean ...
Get Test Driven Development for Embedded C now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.