Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site ea.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!inuxc!pur-ee!uiucdcs!ea!mwm From: mwm@ea.UUCP Newsgroups: net.lang Subject: Re: Re: Gotos; tail-recursion - (nf) Message-ID: <5400012@ea.UUCP> Date: Fri, 29-Jun-84 16:09:00 EDT Article-I.D.: ea.5400012 Posted: Fri Jun 29 16:09:00 1984 Date-Received: Tue, 3-Jul-84 01:43:50 EDT References: <1986@mit-eddi.UUCP> Lines: 36 Nf-ID: #R:mit-eddi:-198600:ea:5400012:000:1613 Nf-From: ea!mwm Jun 29 15:09:00 1984 #R:mit-eddi:-198600:ea:5400012:000:1613 ea!mwm Jun 29 15:09:00 1984 >About the Fortran arithmetic IF: > >I disagree that "any use of the arithmetic IF is a bad use". I have seen >several programs that used the three branches for three distinct actions, >which I feel is as good a use for a three-way branch as can be made. I agree, that is the best use for the silly thing. I think breaking the test out into an else-if chain is both easier to read, and closer to what the implementor was thinking about. If the test is on floating point numbers, you probably should use the else-if chain to take care fuzzy zeros. I'd be *very* interested in seeing a use for the arithmetic IF that wasn't better written as the else-if chain. >Mind you, I'm not defending the arithmetic IF in particular, but I think the >statement that all uses of a particular construct are bad is a bit rash. You're right, but I'm prone to rashness :-). >And yes, I know it's not self-documenting, but then again neither are many >constructs in other languages. For example, reading C programs can be a >real headache sometimes. Any programming language can be a headache to read sometimes. (See what I mean about being prone to rashness? :-). Ever seen Pascal or ALGOL written to look like FORTRAN - no indentation, if-then-else's with null then statements and inverted tests, lots of GOTOs, etc.? The point is that *any* programming construct can be uglified (gee, I seem to be on a binge today :-). The question is whether there are programming constructs that are always ugly. I think the arithmetic IF qualifies, and the code would invariable be better if the thing were written out of it.