Rewrote {big number} of lines of {old language} in {small number} of lines of {hip new language}
By Adrian Sutton
There’s lots of projects these days moving from one language to the next. Whether that’s a good idea or not varies but let’s accept that it was the right choice and the world is a better place for it. One thing really bugs me: inevitably justifications of how successful that move has been includes a claim that the number of lines of code were so significantly reduced.
We rewrote 1.5 million lines of Java in just 6,000 lines of haskell!
The old system was 200k of tangled Java but the new system is just 4000 lines of clojure!
There are two things about these claims that bug me:
- Lines of code is a terrible metric – how have we not learnt that yet?
- Its incredibly rare to do a complete system rewrite and actually build the same thing.
Inevitably the big gains in a rewrite come from a better understanding of business requirements so the new system actually does less stuff. Just because it meets all the same business requirements and maybe even looks the same to users doesn’t mean its doing all the same things or providing the same level of configurability or flexibility. That reduction in scope is what makes it a better system.
Flexibility and configurability is only an asset if you’re actually using it. In all other cases its just waste and should be removed.