>From Symeon: > Yes but this is really really really really really > basic stuff - if you have to think for more than a > second on this type of construct maybe you should not > be a programmer ??
Symeon, I don't think so. Real programmers recognize all kinds of structures, and the brain adjusts with the flow. Maybe I'm just getting older but sometimes my eyes lock onto some line or clause where I need to think harder about the exact ramifications of some expression or logic. What data might cause that code to do something awkward? What data might pass to the else clause? Another example of this "brain stutter" is when you get to a Call or Gosub statement. The mind has to come out of the code for a moment as you go through the mechanics of scrolling to the subroutine or opening a window for another code item. Those of us who work with OOP need to do this a LOT more, and this is one of the things that makes OOP more time consuming than top-down code, even though the structure is perceived as more elegant. 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. And with that in mind, I just squashed an occurrence of this in my own code. So once again this forum has provided value. :) Best, T > From: Tony Gravagno > I think the objection is to this: > > IF A # B THEN FOO ELSE BAR > > It's that Not/Else thing that can bend the brain. > > I think most people prefer: > > IF A = B THEN FOO ... We know what it is, so do this. > ELSE BAR ... do this if the value is unexpected. _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
