5 ms·
> Same way you get joy deleting large swaths of code. This is the true sign of a programmer's transcendence. Specifically the irrational joy of seeing net nega
by koolba 9y ago
> Same way you get joy deleting large swaths of code.
This is the true sign of a programmer's transcendence. Specifically the irrational joy of seeing net negative LOC diffs.
It's not about how much you can add. It's about how much you can remove without sacrificing correctness, functionality, and readability.
- allyjweir 9y ago"The only good diff is a red diff"
- tren 9y ago"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- DonaldPShimoda 9y agoThis is my favorite research quote from a Civilization game (Civ IV, narrated by Leonard Nimoy). I use this as my mantra for all design-oriented aspects of my life now. Or... I try to. Sometimes it's hard not to want to add more haha.
- dv_dt 9y agoFYI that quote is from Antoine de Saint-Exupry, author (and pilot) famous for "The Little Prince".
- eggpy 9y agoDo you know what the context of that quote is? I have used it as a sort of mantra specifically when programming, but I'm guessing it probably was intended for writing.
- mynameisasecret 9y agoI learned this as a rule for all Art. Does this mean programming is an Art? (just joking; I know that it Can be).
- icebraining 9y agoA story about that from the early Apple team: https://www.folklore.org/StoryView.py?project=Macintosh&story=Negative_2000_Lines_Of_Code.txt https://www.folklore.org/StoryView.py?project=Macintosh&stor...
- maxxxxx 9y agoI always tell my team that deleted code is the best code. Obviously less code is often more maintainable but there is also the element of being willing to throw away stuff you did earlier and not being attached to it.
- mstade 9y agoI have a similar take on this, but expand it a bit by arguing that any line of code added – no matter how innocuous – is a liability. It's a line of code that has to be maintained, with all of the responsibilities that come with that. It may be a line that's responsible for adding more value than it costs, but it's still a liability. It won't add value forever, most likely, and when it stops it'll just be debt. It may be cheap debt, but debt nonetheless. Deleted code on the other hand, is never a liability. The act of deleting it may be, but due diligence should ensure it is not.
- chrisbennet 9y agoYes! Every addition carries some risk. The real world example I give to clients/managers of the risk of adding a feature is this: Once I was using an industrial camera that had a mode that allowed it to mirror or “flip” the image output. Unfortunately, after running for a few hours, sometimes it would decide to flip the image on its own. Had that “flip” feature not existed, the bug could never have occurred. The point isn’t that you shouldn’t add useful features, but that even easy to add features aren’t as “free” as they might seem and the risk of adding them should be recognized and weighed against their utility.
- Sohcahtoa82 9y agoI remember teaching a guy about YAGNI - You Ain't Gonna Need It. He would write helper functions that he thought would be useful before writing actual code and often ended up wasting time. Half the functions he wrote, he never actually used, but he'd still spend time writing them and unit tests for them.
- collyw 9y ago
- calibas 9y agoNothing irrational about feeling joy over what is hopefully more succinct and efficient code.
- JKCalhoun 9y agoYes, as long as you recognize where that line of obfuscation (LOO) is and stay just short of it.
- zerostar07 9y agoIt's really code tetris
- mrlyc 9y agoSometimes deleting code isn't enough and you have to do a rewrite. I once rewrote 2,650 lines of C as a seven line shell script. The previous programming team had written a data transfer program with its own implementation of ftp. I just used the one that was already on the computer.
- yitchelle 9y agoThe less code there is, there less opportunity there is for bugs.