Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!mordor!sri-spam!sri-unix!hplabs!tektronix!decvax!mcnc!rti-sel!dg_rtp!throopw From: throopw@dg_rtp.UUCP (Wayne Throop) Newsgroups: comp.lang.c Subject: Re: Phooey on Portability Message-ID: <687@dg_rtp.UUCP> Date: Sat, 8-Nov-86 19:14:01 EST Article-I.D.: dg_rtp.687 Posted: Sat Nov 8 19:14:01 1986 Date-Received: Wed, 12-Nov-86 02:13:08 EST References: <5225@brl-smoke.ARPA> Lines: 47 Summary: No. DOUBLE Phooey on NON-portability! So there! > (poster unknown... "From:" field truncated) First a small nit. > I'd like to get at the byte stored in memory location 6. So I just > struct { char byte; } *MEMORY; > main(){char mybyte = 6->byte;} Gag. Choke. Retch. Puke. I suppose this might work on SOME mickey-mouse compiler/machine/OS combinations, but just LOOK at these gawd-awrfil questionable assumptions! - small integers cast to pointer type gives reasonable results (by no means guaranteed). - struct fields are a global namespace (not even standard C anymore) - conversions of int to pointer types will be implied by the -> operator as needed (definitely not standard C) and probably a zillion more I'm missing! Gad-zooks! > I guess what I'm saying is that until we can > create well-engineered, reliable code for one machine why are we wasting > our time worrrying about doing it for all machines at once? In other words, > portability is mostly a red herring. Good code on one machine beats > bad code on many machines every time. Well, two points I'd like to raise. First, we *CAN* (in some cases) create well-engineered, reliable code for "all machines at once" even now. It's just that the above (let's be kind here) pig swill isn't a good example of how to do it. Second, about portability being a red herring... well, come back and tell me that after you've had to port all the software you've written across three or four generations of machines (due to obsolescence of the older ones) as I've had to do, and THEN maybe I'll believe you. But probably not. And it's likely to get worse rather than better, what with shorter hardware design cycles, RISC, and so on and on. So there, you... you... smug whippersnapper you! -- "Kids these days..." "Yeah, not like the old days, when you could take 'em out and BEAT SOME SENSE INTO 'EM!!!!!" -- Wayne Throop !mcnc!rti-sel!dg_rtp!throopw