2010/3/3 Reuben Thomas <[email protected]> wrote: > 2010/3/3 Wesley Smith <[email protected]>: > > On Tue, Mar 2, 2010 at 1:18 PM, Andrey Fedorov <[email protected]> > wrote: > >> John Zabroski wrote: > >>> > >>> the three stumbling blocks are size, complexity and trustworthiness > >> > >> How are these different? > >> A small program is a simple program by definition, assuming it's > expressed > >> in an intuitively comprehensible way. > > > > I disagree that a small program is by definition a simple program. > > Indeed, and it may help to lay a simple concrete example alongside > Wesley's theoretical approach: think of the difference between, say, a > short recursive function to traverse a tree and apply a callback. It > can even look quite simple on the page, but the chances are that there > are hidden depths. (This is certainly my experience with writing such > functions). Contrast with a long application initialisation routine, > of what I call "narrative" code, which is simply a list of "do this, > do that": initialise the windowing system, start the event loop, > register an event handler, open the main window, initialise the > menus...The code is long, but there are no loops, and it's completely > trivial to read (though how one knows when one has done everything one > needs to is another matter!).
I think I understand exactly what you mean, so let me try to restate in rigorously: you want to include attributes of a given programmer in our definition of "complexity". If we do this, and we consider the "complexity of code" and "size of code" in the eyes of today's "average software engineer", I concede that recursion is more complex than iteration (and "narrative code"). This is simply because of today's fashions. Those aside, I haven't seen any evidence that our minds prefer one metaphor over another. But I'm not interested in the noise added by today's fashions, so I'm trying to intentionally define an algorithm's "complexity" separately from any single person's set of experience, however. So assuming a programmer's native proficient in both a recursive and iterative implementation of a piece of code, the complexity, in her mind, will be roughly equal to the size of the code (and exactly equal to the number of "pieces of thought" that code represents).
_______________________________________________ fonc mailing list [email protected] http://vpri.org/mailman/listinfo/fonc
