5 ms·
Very small programs don't solve complex tasks. If you plan to glue many small, correct programs together you'll likely get unintended behavior from the collecti
by adrianN 11y ago
Very small programs don't solve complex tasks. If you plan to glue many small, correct programs together you'll likely get unintended behavior from the collection. You're just shifting the complexity around.
- taneq 11y agoAnd this is why subdividing code too finely is as bad as not finely enough. In an informal way I think of it as a good design being 'square', as in the design is distributed evenly across all scales. So a small program might have ten functions of about ten lines each. A bigger one might have ten files, each containing about ten functions of about ten lines. It's different in every project but solid, elegant, well structured systems always seem to feel 'square'.
- a3n 11y agoThe collection is a program.
- ska 11y agoVery small programs don't solve complex tasks. That's not quite right (some simple algorithms solve complex tasks). I think it is more true that very small programs can't model or facilitate complex interactions. Your point about shifting complexity around is a good one.
- adrianN 11y agoWell yeah, the universal turing machine has a pretty small program and solves all kinds of problems. But that's not really what I imagine when I say "a simple program".
- ska 11y agoI wasn't being that abstract, I'm thinking of real world systems. Some numerical solvers, graph algorithms, control systems, etc. have this property. They are definitely what I would call a simple program, even if the math behind them is not. YMMV.
- soperj 11y agoAs a contradiction: e=mc^2
- ludamad 11y agoWhich is just a series of symbols. Using it or explaining it is far more complex.
- stcredzero 11y ago...you'll likely get unintended behavior from the collection. You're just shifting the complexity around. This is one of the valid criticisms of OO. "Gluing" small (mostly) correct objects together can produce unforseen results in the aggregate, or can be hard to understand in aggregate.
- marcosdumay 11y agoThat's why you write a very small core with the essential tasks, that include updating the non-core. And then add the complexity in another layer, where failure is handled by the core.
- fapjacks 11y agoSomething interesting about your point is that people will eventually land on this fundamental design as long as they are 1) curious enough about programming to learn new things and 2) continuously improving their abilities. I think what surprised me the most over my lifetime is the number of people writing code that do neither of those things.
- deleted 11y ago[deleted]