Wed 2010-02-24 ( En pr )

If something has more than, say, 5 parameters, it should be divided into components that have less.

Less is more. Hierarchies, if sensibly applied, can manage complexity.

Think LEGO.

Say something! / Sag was!

Interesting thesis oddly enough I tend to agree that 5 is a good guideline, so how does this number came up? Also do you think everything can be cut down to sets of 5? Or rather does it always make sense?

Licenser
Licenser @ 15:37 on Wednesday, 2010-02-24
5 isn't a magic number, just a guide. Actually, even having 2 unnamed parameters for a function can be confusing when you can't remember which one comes first. When you have named parameters, you can have more of them - but at some point, it just explodes. I mean, ActiveRecord's has_many currently has 23 possible options, and some of them take hashes themselves!

I think everything that is software can be broken into parts, yes. But I don't think that's always the way you should go. Some things are just too complex or too strange to be modelled beautifully into a simple set of parameters.

There's another side to this: APIs can't take away the burden of coding, and often, it's easier and better to code it yourself than to fiddle with a hundred APIs.

Maybe libraries shouldn't provide APIs. They should provide tools.

The UNIX philosophy is another example. You just can't model everything, because a model is not the real thing. Original things require original hacks.
murphy @ 21:17 on Thursday, 2010-02-25

No markup, just plain monospace text. / Kein Markup, nur Normschrift-Klartext.