Dr. Meinhold once said that good code is like Mozart symphony. If you add a single note or you take a single note, harmony is destroyed. If you add a single line of code or you take a single line of code, good code will break. ''Hmm, you could add any number of lines without breaking the code. Unless you add them inside some string literals. ;-)'' ---- This is quite a good analogy, but not for the reason Dr Meinhold (who he?) apparently thought. * There are plenty of incremental changes you can make in a piece of music, even a first-rate one, without destroying it. Consider the way that some top-rank composers (Beethoven is the canonical example) were obsessive tinkerers, writing and rewriting until they had just what they wanted. This probably indicates that any incremental change is likely to make the piece ''worse'', but that plenty of incremental changes won't ''break'' it. * Code that can't be changed, even a little, without breaking it is not good. It's fragile and dangerous. Almost all code needs to be changed from time to time, and if it's impossible to do this without making sweeping changes then the code is not fit for its purpose. This wouldn't be true of music, because the natural lifecycle of music doesn't include the same degree of life-long change. It might, I suppose, apply to very highly micro-optimized inner loops or deeply embedded code where every byte counts. In that sort of situation, you sometimes ''do'' need code that's wedged into a local optimum so that small changes will break it. But if much of your code is like that, you're either in an unusual niche or optimizing the wrong objective function. And, similarly, the "small changes break it" property applies to ''some'' rather specialized kinds of music. If you're writing a two-page fugue then the task is very densely constrained, and again you probably can't make small changes without serious damage. But most music is not like this and, in particular, Mozart's symphonies don't include very much music like this. You can make the same sort of analogy to other varieties of art. There are some short poems that could not be altered without damage. But there must be hundreds of places in, say, "Paradise Lost" where Milton could easily have changed two lines without hurting the poem. So: Good code is like good music: mostly, there are plenty of incremental changes that don't hurt it much, but in some special and rare situations you need to write something ingenious and beautiful where incremental changes '''do''' break it. ---- Oh, how interesting. For me, the MozartPrinciple has always been the lesson that the MilosForman film Amadeus attempted to hammer home : you can be an absolute genius at one thing - music in this case - and an absolute dolt in every other thing. We're still on topic, though, as the more general notion in psychology is called "modularity". ;) -- LaurentBossavit ---- Also see HumansSuck, SoftwareCrystal. Contrast with BigBallOfMud and JoelMosesOnAplAndLisp.