>But then I realised that anyone else in our shop reading that would not
understand.
IMO the code I wrote is one of those things that is learned quickly the
first time it is explained vs. something that might be more complicated
that maybe *shouldn't* be used. In the end it is being wise in the ways
you want to help the others on your team push their envelope so they can
become better programmers and making sure you aren't just introducing
"opinion programming".
I had the opportunity this past month to work with a guy that retired on
Dec 31st - a first for me. He was new to /free and new to local sub
procedures and new to chaining without a klist and new to using service
programs, etc, but when it was all said and done he learned A LOT by
having somebody there that was comfortable on the subject matter. The
good thing is he will be doing some side consulting for his employer so
the training wasn't all wasted. The crazy thing is that some of the
things I taught him have been around for over a decade (i.e. ILE with V3R2
I believe was in 1996 or 1998?).
Unless we trickle in new things then our shops are destined to be phased
out and also boring.
Aaron Bartell
http://mowyourlawn.com
David FOXWELL wrote:
Hi Aaron,
My first thought was WAOOUWW! I must do that.
But then I realised that anyone else in our shop reading that would not understand.
Instead of Short way, maybe you should call it the lazy way.
I also had a mental block at first with this :
/FREE
i += 1;
/END-FREE
Instead of
/FREE
i = i + 1;
/END-FREE
But now I do it all the time. I've never once thought that it might irritate my colleagues. Is this kind of syntax custIsVld = (custNbr > 0); used in other languages? What happens if custIsVld is already *on?
-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Aaron Bartell
Envoye : mercredi 7 janvier 2009 14:03
A : RPG programming on the IBM i / System i
Objet : Re: Niftiest thing(s) you have done in RPG ILE or /FREE
I wonder if you changed the question to be more pointed towards certain concepts if you would get more responses. For example, if you asked "what are some cool things you can do in one line of code" then I would think back to something I learned early on that some programmers still don't know you can do:
Long way...
D custIsVld s n
D custNbr s 10 0
/free
if custNbr > 0;
custIsVld = *on;
else;
custIsVld = *off;
endif;
/end-free
Short way...
D custIsVld s n
D custNbr s 10 0
/free
custIsVld = (custNbr > 0);
/end-free
Every time I get involved with a project with another developer/customer I learn a bunch of tidbits that make my code better, compiling easier, or best practices better. The people on this list could write a book on all those cool things, but its all in how to ask the question.
Does the above qualify as at least a smaller nifty thing? :-)
Aaron Bartell
http://mowyourlawn.com
Adam West wrote:
I haven't seen too much as yet.
--
This is the RPG programming on the IBM i / System i (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.