Wednesday, January 28, 2009

My laugh of the day....

Early Unix hackers struggled with this in many ways. In the languages of 1970 function calls were expensive, either because call semantics were complicated (PL/1. Algol) or because the compiler was optimizing for other things like fast inner loops at the expense of call time. Thus, code tended to be written in big lumps. Ken and several of the other early Unix developers knew modularity was a good idea, but they remembered PL/1 and were reluctant to write small functions lest performance go to hell.
Dennis Ritchie encouraged modularity by telling all and sundry that function calls were really, really cheap in C. Everybody started writing small functions and modularizing. Years later we found out that function calls were still expensive on the PDP-11, and VAX code was often spending 50% of its time in the CALLS instruction. Dennis had lied to us! But it was too late; we were all hooked...
-- Steve Johnson


Hmm, I've always wondered why some really old programms written in C look so odd, as if the person had never heard of a function call (or macro) before. I've never been able to figure out if it was because many function calls were more expensive on the hardware back then, because the programmer was used to assembly, or loyality to some "style of the day".


I guess that clears that up a bit more; if so, thank GOD he lied!

No comments:

Post a Comment