----- Original Message -----
From: "McCallion, Martin" <martin.mccallion@misys.com>
To: <midrange-l@midrange.com>
Sent: Monday, December 10, 2001 3:15 AM
Subject: RE: Two persons per product"


> Brad Jensen discussed coding standards, including:
>
> >  no single line IFs.
>
> Everything else you said made sense, but I've never heard of
this as
> being bad practice.  What's the problem?

Of course I left out logic-based indentation.

In BASIC from the old days, you could do

IF X > y then p=p+1else y=y+1

but later VB created

if x > y then
    p = p+1
else
     x=x+1
end if

but it still supported the old form.

The prupose of using the second form over the first is , most of
all, readibility for the human (maybe event he guy who wrote the
program) following the code's logic. In VB it is easy to use
indentation to help with this, including indenting the inside of
DO /LOOP constructs. We restrict the use of WHILE/WEND just to
make the code easier to read - because it does the same thing as a
DO /LOOP.

I also have the habit of indenting the inside of subroutines -
which means none of my code starts at the left margin in VB. This
is only for legibility, it's easier for me to read the code with
whitespace on the left. I don't make my programmers do this. My
point of view is that I need to do everything possible to make it
feasible to write hundreds of lines of debugged code per coding
day (I don't get a lot of coding days anymore. Most of what I
write now gets rewritten for public consumption, if it is used at
all.)

I look at RPG and think, I'd like to buy a vowel, Alex.

And 'CHAIN" to do an indexed lookup? Do you use "SPIKE" to delete
a record? "HAMMER"to display an error message?

"SKSCDK" - Seek and scratch disk, "EJBXPR"to Eject Box of Paper
from Printer?

Sorry, getting way off here.

Time to go to work.

"If you were supposed to understand it, we wouldn't call it
code." - Brad Jensen
think I'll put that on the programmer's door today.

Brad Jensen
elstore.com
LaserVault

PS God I love computers. Don't you?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.