The "Kill Your Darlings" Principle in Computer Science

Good programming means killing ideas that are too clever for the sake of being clever, and good computer science means killing code, frameworks, and languages in order to free up space for new ideas and inventions.


Folksonomies: programming computer science

ReFactoring: Kill Your Darlings

In software design, when you find yourself feeling particularly proud of a neat little bit of design or code, stop and ask yourself how someone who didn't give birth to it will regard it. If it turns out to be overwrought or too slick for the need, you should probably kill your darling and replace it with an ordinary solution that others can actually use, and not just marvel at. Darlings are sometimes characterized as being "ever so clever." For an example, the phrase "ever so clever" is ever so clever.

Notes:

A good principle in software design, related to egoless programming, where developers don't get personally attached to their code, making it easier to cut for more elegant solutions

Folksonomies: programming refactoring

Similarity

\"Kill Your Darlings\" in Computer Science

George Malamidis taught me something about code attachment a few years ago: You always gain by allowing someone to show you an alternative solution. If someone wants to solve a problem in a different way, there are several gains to be had. If their way is inferior, you have an opportunity to mentor a team-mate. If their way is equally elegant, you\'ve gained another solution, or point of view that may be superior in the future. If their way is superior you learn something new and the codebase improves. In exchange for these gains you only need to give up time. Time is valuable, but it\'s also well spent on improving the ability of a team-mate or your personal ability.

Michael Feathers has also written on this topic, specifically focusing on frameworks. In Stunting a Framework, Michael discusses creating small focused frameworks and then letting them go. I think Michael really nailed it with that entry, it\'s definitely worth a quick read.

I think killing your darlings extends beyond codebases and frameworks to languages themselves. At SpeakerConf 2009, I floated the idea that we should more actively seek to kill languages. Perhaps, after 3 versions of a language, it\'s time for that language to be retired. Imagine what we could create if the resources dedicated to Java were instead focused on creating a successor to Java. Think of all the time that would be saved if backwards compatibility became a non-issue.

Notes:

The \"Kill Your Darlings\" concepts applies not only to writing, but to code, frameworks, and languages as well; although, the concept has more to do with opening up the world to improved versions of these things.

Folksonomies: computer programming computer science