DEV Community


Posted on • Originally published at

Beware The Fallacy of Composition

The Fallacy of Composition happens when you assume something that is true for one person, is also true for the entire population.

A trivial example looks like this: If someone stands up out of their seat at a football game, they can see better. The Fallacy would conclude that if everyone stood up, they would all be able to see better.

This is taught in every introductory macroeconomics class as the general form of the paradox of thrift (when there is a recession, you should save more to conserve your finances, but if everyone saves more, it deepens the recession). But not everyone learns economics, and not every economics student understands it deeply enough to realize: this is more common sense than it is economics.

Aside: Yes, common sense should be taught in schools, dont @ me!

Programming Languages

Developers might be more familiar with the famous Bjarne Stroustrup on managing the growth of C++:

"Individually, many (most?) proposals make sense. Together they are insanity to the point of endangering the future of C++."

If you are a fan of Guy Steele's talk on "Growing a Language" (my notes here), this may sound familiar. Java has a number type, but there are reasonable requests to add other important number types: complex numbers, rational numbers, intervals, vectors, matrices, and so on. He concludes:

"I might say “yes” to each one of these, but it is clear that I must say “no” to all of them!"

It's Everywhere

The Fallacy of Composition isn't just limited to language design:

By the way, a lot of TED Talk style speaking works this way - tell a personal anecdote, make that analogy to the problem you're trying to solve, introduce the first bit of halfway credible research that supports the story, applause. Ted Talks churn out Fallacies of Composition at industrial scale. If they were all true we would have achieved Nirvana by now.

Similar quotes:

"Mathematics requires a small dose, not of genius, but of an imaginative freedom which, in a larger dose, would be insanity." - Angus Rogers, via Grant Sanderson of ThreeBlue1Brown

The other day I made an offhand comment to my friend Joe about how the recent trend of Indie Maker group challenges (like his) can be counterproductive. He didn't get it right away, so I had to write this post. I think, if you took a better look at the things you believe and advise people to do, you'll find many, many more examples of the Fallacy of Composition.

Top comments (4)

xazzzi profile image

Would be funny if the author gave a TED talk based on this article.

ryansolid profile image
Ryan Carniato

This is non-obvious a lot of the time. It's basically the fallacy that a lot of Science Fiction pokes at. Isaac Asimov's Robot novels and rules of Robotics for example. The fictional future often includes a combination of a lot of good things that are seemingly perfect but in reality, quite sensibly don't add up.

darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️ • Edited

Yes, common sense should be taught in schools

Schools really should put more emphasis on teaching basic logic causalities like this.

As for the main point of the article; I think a good example of avoiding this effect is Lua.

Quoting Roberto Ierusalimschy:

add that and that and that, put that out, and in the end we understand the final conclusion will not satisfy most people and we will not put all the options everybody wants, so we don’t put anything. In the end, strict mode is a reasonable compromise.

I think this statement really expresses the logical extreme of the "yes to each no to all" problem, by defaulting to "no to any" unless there's good enough reason to believe a particular change is without doubt the right decision for the language. And having used both Lua (mostly privately) and Ruby (mostly for work), I really do like how the language stability leads to a very concise and reasonable design. Ruby, for all its cool features, is also stuck with more than a few "legacy" features that turned out to not be as good a choice as it seemed at the time, despite being somewhat picky about what features to add:

The most popular question is: "I’m from the language X community; can’t you introduce a feature from the language X to Ruby?", or something like that. And my usual answer to these requests is… "no, I wouldn’t do that", because we have different language design and different language development policies.
—Yukihiro Matsumoto, in a recent interview

eelstork profile image

So they did ignore Stroustrup after all!