|
I tend to agree with you on your questioning of prefixing variable types. We tend to following the redbook suggestion of prefixing basing pointer with p and the rest of it is the variable for which it is a pointer. I don't see how the following: read(e) myfile; if %status(myfile)=EndOfFile; is improved by read(e) myfile; if %status(myfile)=Const_EndOfFile; Much as I hate the redundancy of: Object Type Library BPCSJOBQ *JOBQ PAIDIVO BPCSJOBD *JOBD PAIDIVO Which looks really cute in the IFS: wrklnk '/qsys.lib/paidivo.lib/bpcs*.*' Directory . . . . : /qsys.lib/paidivo.lib Object link Type BPCSJOBD.JOBD JOBD BPCSJOBQ.JOBQ JOBQ Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com "Christen, Duane J." <dchristen@xxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 12/28/2004 10:21 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc Subject RE: Long Constant Names Personally I don't understand prefixing variable types. Other than file fields, which are all caps, and basing pointers which we end in "Base" we have no variable type "tagging". IMHO the context that the variable is used, and/or its name, should tell you what the variable is, if you are still not sure and need to know exactly, look at the compile listing. As far as variable name length, whatever length feels comfortable and identifies the data held by the variable. Duane -----Original Message----- From: Steve Richter [mailto:stephenrichter@xxxxxxxxx] Sent: Tuesday, December 28, 2004 7:47 AM To: RPG programming on the AS400 / iSeries Subject: Re: Long Constant Names On Tue, 28 Dec 2004 11:24:52 +0100, antoine.contal@xxxxxxx <antoine.contal@xxxxxxx> wrote: > > > Hi group, > > 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. > > I think this name is already on the short side. Using so many abbreviations won't make newcomers' work any easier. Still, isn't it more readable than wwASUFM for instance? > > Did anyone already have this argument? What were the decisive factors and what did you choose in the end? long name. I try to organize the long name to make it meaningful within the application as a whole. all constants start with "con" use a "_" character to group sets of constants. kind of the equivalent of the enum in c++: conItStat_Open conItStat_Closed conItStat_Ready where "con" means constant "itstat" is a field name in the database what follows the "_" are the meaningful names of each permitted value for that field. -Steve -- 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. NOTICE: This electronic mail transmission may contain confidential information and is intended only for the person(s) named. Any use, copying or disclosure by any other person is strictly prohibited. If you have received this transmission in error, please notify the sender via e-mail. -- 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-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.