× 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.



I've heard the critique before, but i chose the short names deliberately to
get compact code that is good readable. It takes a little bit of getting
used to, but the short names make the code a lot clearer (and less typing).

It also doesn't help, i think, that - maybe - we still have some trauma
left from RPGII, max six uppercase character names everywhere. That was
really bad, but not because you needed to write "EXSR", but "CUZC@".

John already explained it very well. There is a limited number of keywords,
which you use repeatedly. Writing "set-lower-limit" everytime gets boring
quite fast. As long as the application specific variable names have
sensible names, the keywords should be short. Also because in RpgMap you
would more than usual use nested procedure calls. The short procedure names
also have some logic in them, such as rdn (read-next), and rdp
(read-previous). They're easy to memorize. If you know that "sll" is
set-lower-limit then "sgt" does not need explaining anymore.

I much prefer:
cur = rm_sll(rm_cur(map):rm_a('a'));

Instead of:
cur = rpgmap_setLowerLimit(rpgmap_NewCursor(map):rpgmap_NewChar('a'));

The second example is only somewhat clearer in what it does if you're just
trying to guess what the code does.

The 'a' and "map" are the important parts, which are easier readable in the
first example. They get more buried within the rest of all the text in the
second example (low signal-to-noise ratio). The first example is easier to
read, but only if you know what "sll" and "a" do, of course. But you have
to read the docs anyway.

Long descriptive identifier names are good, but not always.


On Sat, Jul 22, 2017 at 11:48 PM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

Mihael also preferred longer and more descriptive names. I am less
opposed to the shorter names. I don't think I would have chosen
*these* names, but I probably would have chosen shorter than what you
and Mihael seem to prefer, and I don't have a particularly strong
negative reaction to these names.

There is a school of thought that goes: You have to learn keywords
anyway. They have special meaning in the language, just like you would
learn mathematical symbols. If there aren't too many of them to learn,
and they will be showing up all over the place, it is nice to have
them short. Variables and functions you write yourself can have names
as descriptive (and as verbose) as you want.

But by no means are you alone. Agreeing with Mihael already puts you
in good stead. I think there are lots of programmers and language
designers on both (or all?) sides of the issue of how to choose
keywords.

John Y.
--
This is the RPG programming on the IBM i (AS/400 and 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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.