Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
The Perils of Refactoring Typos
/via http://www.commitstrip.com/en/2018/11/26/if-its-not-broken/
Funny cartoon, but the whole "Donât refactor craetionDtaeâ, thing is a bit far-fetched, right Youâd probably fix that typo without thinking twice about it, right?
Wellllll, maybe not. After all, this might actually be something that is exposed to users (itâs in the API. Yay), so you need to refactor this and the documentation, but thatâs OK, you can do that, right?
Wellllll, maybe not. Because, now that you look, you notice that youâve got two sets of typos, craetionDtae and craetionDate, which means that refactoring means that you need to update both of these in the code and the docs, so now itâs 4 things that need to be changed, but itâs ok, youâve got that, you can do it, right?
Wellllll, maybe not. Because, now that you really look, you realize that craetionDate also exists as craetionDates (because, you had to pluralize the array, didnât you?) and craetionDateForUser (because you forgot that craetionDate already existed), and now stuff has grown exponentially, and youâre not really sure that the refactoring wonât f**k with the other names, and itâs all just too much now.
And thatâs the real reason you didnât go ahead with refactoring it, right?
Wellllll, maybe not. In reality, itâs probably just that one craetionDtae typo, and nothing else. However, you donât know! And, because of that, youâre probably not going to actually do anything, and craetionDate will live on forever in your code.(And, a couple of years from now, when youâre long gone, nobody else will refactor it because they donât know either, and assume that you probably had a reason for thisâŠ)
(This article also appears on my blog)
The Perils of Refactoring was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.