01.06.2016 Views

Hacker Bits, June 2016

HACKER BITS is the monthly magazine that gives you the hottest technology and startup stories crowdsourced by the readers of Hacker News. We select from the top voted stories and publish them in an easy-to-read magazine format. Get HACKER BITS delivered to your inbox every month! For more, visit http://hackerbits.com/2016-06.

HACKER BITS is the monthly magazine that gives you the hottest technology and startup stories crowdsourced by the readers of Hacker News. We select from the top voted stories and publish them in an easy-to-read magazine format.

Get HACKER BITS delivered to your inbox every month! For more, visit http://hackerbits.com/2016-06.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

When is rewrite the<br />

answer?<br />

Joel Spolsky made strong arguments<br />

against rewrite and<br />

suggests that one should never<br />

do it. I’m not so sure about it.<br />

Sometimes incremental improvements<br />

and refactoring are<br />

very difficult and the only way<br />

to understand the code is to<br />

rewrite it. Plus software developers<br />

love to write code and create<br />

new things – it’s boring to read<br />

someone else’s code and try to<br />

understand their code and their<br />

‘mental abstractions’. But good<br />

programmers are also good<br />

maintainers.<br />

If you want to rewrite, do it<br />

for the right reasons and plan<br />

properly for the following:<br />

• The old code will still need<br />

to be maintained, in some<br />

cases, long after you release<br />

the new version. Maintaining<br />

two versions of code will<br />

require huge efforts and you<br />

need to ask yourself if you<br />

have enough time and resources<br />

to justify that based<br />

on the size of the project.<br />

• Think about losing other opportunities<br />

and prioritize.<br />

• Rewriting a big system is<br />

riskier than smaller ones.<br />

Ask yourself if you can<br />

incrementally rewrite. We<br />

switched to a new database,<br />

became a ‘Service Oriented<br />

Architecture’ and changed<br />

our protocols to binary, all<br />

at the same time. We could<br />

have introduced each of<br />

these changes incrementally.<br />

• Consider the developers’<br />

bias. When developers want<br />

to learn a new technology or<br />

language, they want to write<br />

some code in it. While I’m<br />

not against it and it’s a sign<br />

of a good environment and<br />

culture, you should take this<br />

into consideration and weigh<br />

it against risks and opportunities.<br />

Michael Meadows made excellent<br />

observations on when the<br />

“BIG” rewrite becomes necessary:<br />

Technical<br />

• The coupling of components<br />

is so high that changes to a<br />

single component cannot be<br />

isolated from other components.<br />

A redesign of a single<br />

component results in a<br />

cascade of changes not only<br />

to adjacent components, but<br />

indirectly to all components.<br />

• The technology stack is so<br />

complicated that future state<br />

design necessitates multiple<br />

infrastructure changes.<br />

This would be necessary in a<br />

complete rewrite as well, but<br />

if it’s required in an incremental<br />

redesign, then you<br />

lose that advantage.<br />

• Redesigning a component<br />

results in a complete rewrite<br />

of that component anyway,<br />

because the existing design<br />

is so fubar that there’s nothing<br />

worth saving. Again, you<br />

lose the advantage if this is<br />

the case.<br />

Political<br />

• The sponsors cannot be<br />

made to understand that<br />

an incremental redesign<br />

requires a long-term commitment<br />

to the project.<br />

Inevitably, most organizations<br />

lose the appetite for<br />

the continuing budget drain<br />

that an incremental redesign<br />

creates. This loss of appetite<br />

is inevitable for a rewrite as<br />

well, but the sponsors will<br />

be more inclined to continue,<br />

because they don’t want<br />

to be split between a partially<br />

complete new system<br />

and a partially obsolete old<br />

system.<br />

• The users of the system are<br />

too attached to their “current<br />

screens.” If this is the case,<br />

you won’t have the license<br />

to improve a vital part of the<br />

system (the front-end). A<br />

redesign lets you circumvent<br />

this problem, since they’re<br />

starting with something new.<br />

They’ll still insist on getting<br />

“the same screens,” but you<br />

have a little more ammunition<br />

to push back. Keep in<br />

mind that the total cost of<br />

redesigning incrementally<br />

is always higher than doing<br />

a complete rewrite, but the<br />

impact to the organization<br />

is usually smaller. In my<br />

opinion, if you can justify a<br />

rewrite, and you have superstar<br />

developers, then do it.<br />

Abandoning working projects<br />

is dangerous and we wasted<br />

an enormous amount of money<br />

and time duplicating working<br />

functionality we already had, rejected<br />

new features, irritated the<br />

customer and delayed ourselves<br />

by years. If you are embarking<br />

on a rewrite journey, all the<br />

power to you, but make sure<br />

you do it for the right reasons,<br />

understand the risks and plan<br />

for it. •<br />

Reprinted with permission of the original author. First appeared at codeahoy.com.<br />

54 hacker bits

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!