Don’t future-proof your code
<p>What you think might happen doesn’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’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’s the thing…</p>
<p>Those extra fields, logic changes, and reusable resources don’t come for free.</p>
<p>They cost time & effort. You’ll take longer to deliver the first version when you’re constantly revising the design to compensate for anticipated needs.</p>
<p>Unfortunately, that extra effort will probably be wasted.</p>
<h1>You don’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’t.</p>
<p>If you’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’t be needed.</p>
<p>It’s a difficult lesson to learn. One that many senior engineers haven’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>