Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!bu-cs!bzs From: bzs@bu-cs.UUCP Newsgroups: comp.lang.c Subject: Re: Portable C vs Efficient C or "Cost of Portability" Message-ID: <6446@bu-cs.BU.EDU> Date: Sun, 12-Apr-87 16:03:52 EST Article-I.D.: bu-cs.6446 Posted: Sun Apr 12 16:03:52 1987 Date-Received: Mon, 13-Apr-87 23:45:22 EST References: <213@pyuxe.UUCP> <636@edge.UUCP> Organization: Boston U. Comp. Sci. Lines: 39 In-reply-to: doug@edge.UUCP's message of 10 Apr 87 22:03:47 GMT Posting-Front-End: GNU Emacs 18.41.4 of Mon Mar 23 1987 on bu-cs (berkeley-unix) I believe "portability" will become the "goto-less" programming of the 80's. In both cases the suggestions should be applied 98% of the time. The use of goto programming before "the movement" was rampant and causing all sorts of difficulty. I experienced that, I worked with large Fortran programs in which GOTO was the favorite control construct, necessary or not and usually badly thought out (like jumping out and back into the same code segment so the new code can be put at the bottom, no joke.) It was argued that some of this Fortran code was getting all the useful work done in the interstices of the gotos :-) Then came the prosletytes, for example the professors who gave an F on any programming assignment that contained a goto, no matter what the reason (I've personally known professors here with that policy only a few years ago.) Of course that was nonesense. We finally (at least those of us getting work done) came to some agreement that goto's were ok under certain conditions (eg. jumping out of a multiply nested loop on an error condition to quickly "give up", rather than adding noisy bells and whistles flags.) I assume we are somewhere in the same cycle with portability, with the same healthy result. As with gotos, we want to think *real* hard before introducing non-portability into a program. For example, if you can get significant performance increase (which you can demonstrate you can benefit from) and even conditionalize the code so it decides whether to compile portably or not, then go to it. And know the consequences. That's all. Common sense. 98% of the non-portable code smashed (hopefully) just like 98% of the gotos. We all win. -Barry Shein, Boston University