Why Accidentally Quadratic?
accidentallyquadratic.tumblr.com
accidentallyquadratic.tumblr.com
I wish more developers thought like that. As someone who usually uses hardware that is several years old, I'm always annoyed that my system seems to get worse and worse with every software "update" I do.
The first Mac OS X upgrades were similar, they made your old iMac do things faster.
I don't know how to make devs create non bloated programs, I often think we should give them really old systems to write on. Constraint drives creativity etc etc.
If it were up to me, I'd spend this entire year refactoring, but it's not.
Just give devs antiquated test/production rigs. That's entirely reasonable. A particularly frugal employer of mine refused to pay for a web/application server with more than 512MB of RAM. That was a fun job, actually.
Not production code, but when learning about recursion at uni someone implemented fibonacci like
fib (a) { return fib(a-1) + fib(a-2) }
(with a base case, obviously). So fib(6) would generate calls to fib(5) and fib(4), which would spawn calls to fib(4), fib(3) and fib(3), fib(2). Those 4 would again spawn 2 new calls each, many of them overlapping.
Yes. The biggest source of this problem is that someone calling a function doesn't know how that function actually works and what its time complexity is. Sometimes it's that a function is asymptotically slower than it needs to be, but often it's that writing a composite of the calling and called functions could result in combining an inner and outer loop.
When you use large libraries that do more complex things, your opportunity to optimize across levels goes away because you can't know all the code and where this issue will come up.
It's not bad to use the simplest strategy you can get away with.