I am not crazy about IF (condition) ELSE logic but the compiler supports it.  
The versions of Information I was on did not support THEN on the reads until 
the 90s.  Once it was available we jumped on it.

> Date: Fri, 4 Mar 2011 13:25:48 +0000
> From: [email protected]
> To: [email protected]
> Subject: Re: [U2] Is this worth rewriting?
> 
> What absolute and utter rubbish!
> 
> You never had to write "IF (test) ELSE ..." in Pick.
> READ did have a THEN clause as far back as I can remember (mid-80s) -
> only LOCKED came later.
> You just don't use it that often because you usually only want to do
> something if your READ fails.
> Typically READ rec FROM FILE,Id ELSE rec = ""
> IF is different. I at least expect that after a test I'll do something
> if the condition is true.
> The ELSE clause is optional.
> I wasn't even aware you could leave the THEN clause out until I
> encountered some code that did that.
> That is IMHO one of the worst coding sins and I always change it to IF
> NOT(test) THEN if I find it anywhere.
> I just have been bitten too many times with this nonsense code.
> Aren't I lucky that I don't have to maintain your code? :-P
> You wouldn't say ' if you brush your teeth else you get decay' in a
> conversation, so why would you want to do it in your code?
> But hey, why make life easy for the next guy if with a little bit of
> effort you can make it really difficult?
> If it was hard to write it should be hard to read, right?
> 
> The only thing that forced us to write code as compact as possible in
> the really olden days was the 32K item size limit.
> 
> 
> 
> On 04/03/2011 10:50, Wols Lists wrote:
> > On 03/03/11 20:50, Tony Gravagno wrote:
> >> Some people apparently have brains that toggle IF NOT ELSE faster
> >> than others.  But apparently this construct is of concern to some
> >> people, whether as a matter of elegance or a matter of coding
> >> effectiveness.  Recognizing this, the more I can eliminate those
> >> lines where I or someone else needs to "brain stutter" out of the
> >> flow, the better I think the code is.
> >>
> > Problem is, what causes some people to stutter is what other people find
> > easy. Two cases in point ...
> >
> > A lot of my code does "if (test) else", which is a very "pick"
> > construct. In fact, a lot of code *had* to be written that way because a
> > lot of conditional statements (READ etc) didn't have a THEN back then.
> >
> > And when I was learning C. I taught my instructor a trick or two - an
> > exercise was to count how many 3's in a pack of cards. So I did
> >
> > count += (value == 3);
> >
> > When I read my code out for the instructor to write on the board, he
> > just couldn't hear it right until I spelt it out letter by letter.
> > Again, it's stuff I'd expect a Pickie to do without having to think! But
> > the instructor just couldn't get it until he'd written it on the board
> > and took a good hard look.
> >
> > Cheers,
> > Wol
> > _______________________________________________
> > U2-Users mailing list
> > [email protected]
> > http://listserver.u2ug.org/mailman/listinfo/u2-users
> >
> >
> _______________________________________________
> U2-Users mailing list
> [email protected]
> http://listserver.u2ug.org/mailman/listinfo/u2-users
                                          
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to