On Fri, Mar 11, 2011 at 5:18 PM, Didier Verna didier@lrde.epita.fr wrote:
It is well known that a functional approach to programming helps thinking in a top-down fashion. Idioms made available by first-class functions (e.g. mapping and folding) help you write down the general ideas first, and worry about the details later. Paul Graham has nice examples of that in On Lisp IIRC.
In fact 'On Lisp' makes the opposite point. From the Preface: 'As well as writing their programs down toward the language, experienced Lisp programmers build the language up toward their programs. This book teaches how to program in the bottom-up style for which Lisp is inherently well-suited.'
During the brief period of my university career when people were trying to teach me programming, top down ('structured') was the way to go, not just in Pascal, but in COBOL as well. But that was when writing a program meant using a pen and a specially printed pad of paper (with the important columns highlighted), so having one's first thoughts accepted by a compiler was not an issue. It was also an era where the usual (or at least assumed) case was a well-specified outcome e.g. produce this report that takes 3 accounts clerks 1 week to produce in only one overnight batch job. PG (in 'On Lisp') says this era is over, and that specifications are now 'extremely complex, or even open-ended.' He continues: ' The theme of this book is twofold: that Lisp is a natural language for programs written in the bottom-up style, and that the bottom-up style is a natural way to write Lisp programs.'
To answer your questions: both. As, I suspect, for all programmers, always, everywhere.
JQS