|
Barbara: For example - we are on V5R1 (and have to stay there until some major apps that use the QDLS file system get rewritten), so using %DEC to convert strings to numeric is not yet an option for us. I found your GetNum function in Usenet. It's been very useful. But with our naming conventions, it's called ArvString_Getnum, and that has to be split over two lines with an ellipsis. But it's useful, albeit a bit long, because I know instantly which /copy member I need to put in (/Copy QCPYLESRC,ARVSTRING). Francis Lapeyre IS Dept. Programmer/Analyst Stewart Enterprises, Inc. E-mail: flapeyre (at) stei (dot) com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris Sent: Wednesday, December 29, 2004 1:41 PM To: rpg400-l@xxxxxxxxxxxx Subject: Re: Long Constant Names antoine.contal@xxxxxxx wrote: > > I'm having an argument with the team that choose our shop's coding style conventions. I'd like to have your opinion on the subject. > > The heart of the matter lies in this kind of constant declaration: > > DwwAppStateUpdFailMsg... > D C '...' > > (ww is a prefix we have to add in front of variables and constants, to > differentiate them from file fields) > > The convention team says this name is too long. They want everybody to keep their names within the 15-character limit -- indeed, 13 meaningful characters after you add the two-character prefix. > ... Is the convention team trying to prevent the use of ... in names, or just to keep name-lengths 15 or less? If the rule is against the ..., then what about name indentation? If you use indentation to show the organization of a data structure, you have even fewer characters for the names. I think the rule should be that names should be as terse as possible while retaining enough information to make them easily remembered. A good set of abbreviations (like Msg, Upd etc) should be established, so you don't get names like wwApplicationStateUpdateFailMessage, or two too-similar names like wwHaveRec and wwHaveRcd. Aside: A few times I've been unable to come up with a good name for a variable; it's usually turned out that it was better to do my coding a completely different way. My Rule of Thumb: If you can't name the variable, try rethinking the algorithm. -- 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.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.