[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: following up on speed




At Sat, 20 Jul 2002 16:43:10 +0200, Michael Sperber [Mr.  Preprocessor] wrote:
> >>>>> "Daniel" == Daniel Weinreb <DLWeinreb@attbi.com> writes:
> 
> Daniel> At MIT, we were taught to think about semantics and abstraction much
> Daniel> more than we were taught
> Daniel> to think about performance. There is a real danger in taking this
> Daniel> approach too far.
> 
> Daniel> Those of you on this list who regularly initiate
> Daniel> undergraduates into the mysteries of Scheme: do you teach them
> Daniel> performance analysis? In the first semester?
> 
> Not in the first semester.  IMHO, performance analysis, to be
> meaningful at all, requires a basic understanding of the execution and
> machine model, which usually happens later in the intro sequence of
> courses.
> 
> The real reason for not doing it that early, however, is that
> beginning students have a tendency to take new techniques too far:
> 

Mile's right. I introduce it in the sophomore/junior level course on 
principles of PLs. I slowly take apart an interpreter, get an abstract
machine, and eventually a gc. I note how things affects performance. 

I have always wished that the algorithms course in the second semester
be based on performance analysis and performance debugging of somewhat
larger programs. I could never convince a colleague. 

As for tail-recursion, I have stopped mentioning the word to beginners. 
It's pointless. If you want them to think "loop", teach them about 
map, for-each, andmap, ormap, foldr, build-list, etcetc. Never mind that
tail-recursion stuff. 

-- Matthias