× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Joe,Hans,

Lack of MOVE in free-format wouldn't bother me so much, 
if the need to put /free,/end-free, to switch from free to fixed and back
was removed.

Surely the presence of the spec, eg C,D,F etc on the left is enough to
indicate that it's a fixed format line.

This would help make mixed fixed/free code a lot tidier. 

And although the MOVE opcode is powerful, its very power may be the cause of
many bugs over the years, 
as it packs a heck of a lot of functionality in one opcode, tthat you can
easily get wrong.

As with all things in this game, its swings and roundabouts!   

cheers
Colin.W
 
Extension   353
Direct dial   0870 429 6676
 


-----Original Message-----
From: Joe Pluta [mailto:joepluta@xxxxxxxxxxxxxxxxx] 
Sent: 18 May 2004 04:13
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Compile error when using field in a subfield data structure


> With a
> fixed-form system, there's only one way to code, and so it's hard to
get
> it wrong. With free-form coding (as is the case with practically every 
> other programming language out there), you have to apply some
discipline
> to ensure your code is readable.

It's no harder "to get it wrong" with fixed format code than with free form.
Other than indenting, there's no difference between the languages, except
for those that the RPG team has artificially contrived.  In fact, according
to your later statement, it's actually EASIER to hide bad code in fixed
format than in free format.


> As I said, this isn't a problem if
> you're used to coding in another language and you already know how to 
> format code. But unfortunately, it seems to be a new concept for some 
> number of RPG coders.

Uh, Hans?  For some RPG coders, it IS a new concept.  Duh.  But "formatting
code" is a lot more than indenting.  There are multiple schools of thought
on nearly every decision in the process, from number of spaces to where to
hang your end opcodes.


> For those who need some guidelines, the most important thing about 
> free-form coding is consistent indenting:
> 1) Start at column 8, and for each new nesting level, indent 3 
> characters. That is, the code within a IF, DOW, DOU, or subroutine
block
> should be indented 3 characters in from the IF, DOW, DOU, or BEGSR 
> statement.
> 2) The ENDxx statement should be indented the same amount as the 
> corresponding IF, DOW, DOU, etc.
> 3) Comments should be indented at the same level as code.

This is one man's opinion, and ignores the hard stuff, including how to
properly break multi-line statements, handling selects, and a number of
other topics.


> Another issue may well be that proper indentation of free-form code
may
> well magnify and emphasize a design structure that's poor to begin
with.
> It's easy to hide a poor code structure in a "straight-line" fixed 
> coding style!

Hey Hans!  Flip!  Flop!  Flip!  Flop!  Earlier you said it's easier to code
properly in fixed format!  Now you say it's easier to code bad code in fixed
format!

Hey, maybe IT'S JUST EASIER TO CODE IN FIXED FORMAT!  Wow, what a novel
concept!

Actually, the truth is that choice is personal, like choosing an IDE, and
comparing the two on any sort of absolute basis is just bombast. Poor code
lives in any syntax.  As an example, one of the poorest coding techniques
ever devised can only be accomplished in C and its
derivatives: the misuse of the "for" construct as a generic looping
mechanism.  But your implication here is that somehow programmers stick to
fixed format to hide bad code.  I suggest you correct that perception, Hans,
unless you wish to cultivate a reputation as an elitist.


> Personally, though, it just boggles my mind that so many RPG
programmers
> have such a strong attachment to the old fixed-form style. Sometimes 
> this debate reminds me of the following quote: "If you've been
pounding
> nails with your forehead for years, it may feel strange the first time 
> somebody hands you a hammer. But that doesn't mean that you should
strap
> the hammer to a headband just to give your skull that old familiar 
> jolt." --Wayne Throop. It would appear that some RPG programmers still 
> prefer using their forehead.  :-(

There is no debate, Hans.  Some people simply prefer fixed format.  They
have as much right to their opinion as you do to yours.

But frankly, many of us have been slower in the uptake of free format than
we would have otherwise because you decided to remove the MOVE opcode.
Because there is no MOVE, there is no clean way to mechanically translate to
entirely free format code, as there was from RPG III to RPG IV.  This single
act of ... what?  Arrogance?  Misguided elitism? Whatever the reasoning,
that decision has slowed down the uptake of /free more than perhaps any
other single thing.

So when you want to blame someone for the lack of acceptance of /free, look
in the mirror.

Joe

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


This e-mail has been sent by a company of Bertram Group Ltd, whose registered 
office is The Nest, Rosary Road Norwich NR1 1TF. 
This message, and any attachments, are intended solely for the addressee and 
may contain privileged or confidential information.  If you are not the 
intended recipient, any disclosure, copying, distribution or any action taken 
or omitted to be taken in reliance on it, is prohibited and may be unlawful.  
If you believe that you have received this email in error, please contact the 
sender immediately. Opinions, conclusions and statements of intent in this 
e-mail are those of the sender and will not bind a Bertram Group Ltd company 
unless confirmed in writing by a director independently of this message. 
Although we have taken steps to ensure that this email and any attachments are 
free from any virus, we advise that in keeping with good computing practice the 
recipient should ensure they are actually virus free.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.