4 ms·
>I have run a a little programming experiment Does anyone know what these test problems and solutions were? Or have similar examples?
by jmilloy 13y ago
>I have run a a little programming experiment
Does anyone know what these test problems and solutions were? Or have similar examples?
- jloughry 13y agoThe thing that comes to mind is the C idiom for copying strings: while(dest++ = src++); "...their notion of repetition was so tightly connected to the idea of an associated controlled variable to be stepped up, that they were mentally blocked from seeing the obvious."
- Nilzor 13y agoIs this example really relevant today? Who cares if you write while(dest++ = src++) or for (int i = 0; i < src.length; i++) { dest[i] = src[i] }; Was he just worried that the number of keywords and programming concepts were to many and made the language to complex? He would loath C++ then... Still, we seem to get by.
- jmilloy 13y agoI'm not sure I agree; aren't dest and src still variables that are being stepped up? Maybe they are not "controlled variables", I don't know what that means. This is a task that is eminently suited to repetition, any loop makes sense. Plus, the article mentions FORTRAN's DO loop (not just for loops incrementing a counter). I was expecting an example where a loop worked, but a simpler mathematical solution exists without a loop. Anyone else?
- lesterbuck 13y agoI came away from that paper with notes to track down exactly the same information. Alas, there does not seem to be a definitive answer. Googling a unique phrase from the relevant text, this seems to be the main discussion: http://www.techques.com/question/13-113751/What-task-did-Dijkstra-give-volunteers,-which-was-mentioned-in-his-paper-The-Humble-Programmer http://www.techques.com/question/13-113751/What-task-did-Dij... The "answer" is the classic Dining Philosophers problem, which Dijkstra himself invented to illustrate the issues of concurrent programming. It isn't clear that this is actually what he meant, but it's probably the best we are going to get now that he is gone.