Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!genrad!panda!talcott!harvard!seismo!rochester!ritcv!ccivax!rb From: rb@ccivax.UUCP (rex ballard) Newsgroups: net.lang.c Subject: Re: fast code and no morals Message-ID: <367@ccivax.UUCP> Date: Fri, 31-Jan-86 21:26:48 EST Article-I.D.: ccivax.367 Posted: Fri Jan 31 21:26:48 1986 Date-Received: Mon, 3-Feb-86 04:51:54 EST References: <842@megaron.UUCP> <489@zinfandel.UUCP> Reply-To: rb@ccivax.UUCP (What's in a name ?) Distribution: net Organization: CCI Telephony Systems Group, Rochester NY Lines: 23 Summary: "Duffs Devices" - more In article <489@zinfandel.UUCP> berry@zinfandel.UUCP (Berry Kercheval) writes: > [very bizarre code involving switches] >I think I'll name it after myself -- ``Duff's Device'' has a nice ring to it. > >It amazes me that after 10 years of writing C there are still little corners >that I haven't explored fully. (Actually, I have another revolting way to >use switches to implement interrupt driven state machines but it's too >horrid to go into.) > >Tom Duff {ucbvax,decvax,ihnp4,...}!alice!td Sounds kinky, I'd love to see it. There is a point where 'Religion in Languages' is detremental. Sure, if a compiler/machine can produce better code in 'Structured C' than in 'Kludge C', that's great! I know of only one machine where this is even close to the case! Other-wise, there are a few folks writing code for controllers and things, that needs to be FAST, on a CPU that thinks a call is an 'invitation to an interrupt'. Tricks like quick-switches, and even 'function returning pointer to funtion...' are very necessary. For a good tutorial in 'Kludge C' look at the source to Unix (Version 6 is particularly cute).