Wacky Programming Tales

Ben Caradoc-Davies bmcd at es.co.nz
Sat Aug 14 23:14:48 EDT 1999


[strange programming]
The most confidence uninspiring piece of code I ever had the displeasure to
maintain contained something like this (allegedly C++, but mainly it's 
intersection with C):

	i = 0;
	while( i < max_index ) {
		/* some copying or update (not modifying i) goes here */
		i = i + 1;
	}

This was written by a *very* expensive consultant working for a large
multinational accountancy firm.

Can anybody suggest an alternative construct which more accurately expresses
the programmer's intentions? There may be more than one way to do it, but,
puhleeze!

Idiomatic is not quite the word.

-- 
Ben Caradoc-Davies <bmcd at es.co.nz>




More information about the Python-list mailing list