Don’t future-proof your code

<p>What you think might happen doesn&rsquo;t matter.</p> <p>Developers love to future-proof their plans. They want to make sure that they anticipate future needs and code accordingly. The bad news is: humans are quite bad at predicting the future.</p> <p>This is a key lesson. Anticipatory coding is often wasted effort.</p> <h1>It&rsquo;s a trap!</h1> <p>Experienced and novice engineers alike fall into the trap.</p> <p>They try to guess what will come next. They work those changes into the current design.</p> <p>Practically, this means adding some extra fields to a database, refactoring existing logic to be more performant, or creating reusable resources in anticipation of more future requests.</p> <p>Here&rsquo;s the thing&hellip;</p> <p>Those extra fields, logic changes, and reusable resources don&rsquo;t come for free.</p> <p>They cost time &amp; effort. You&rsquo;ll take longer to deliver the first version when you&rsquo;re constantly revising the design to compensate for anticipated needs.</p> <p>Unfortunately, that extra effort will probably be wasted.</p> <h1>You don&rsquo;t know what you think you know</h1> <p>Right now, you might feel like you understand what the business will need in the future.</p> <p>I can promise, you don&rsquo;t.</p> <p>If you&rsquo;re lucky, you can anticipate future needs maybe 1 out of 10 times.</p> <p>The other 9 times, you wasted effort and complexity future-proofing a design for something that will change or won&rsquo;t be needed.</p> <p>It&rsquo;s a difficult lesson to learn. One that many senior engineers haven&rsquo;t internalized even. We get sucked into the trap again and again. Writing code in anticipation of some future state.</p> <p><a href="https://blog.developerpurpose.com/dont-future-proof-your-code-aad04ef75584">Click Here</a></p>
Tags: Code trap