Hmmm... SQL uses <>, doesn't it?
SQL also accepts != and ¬= but both are not language independent. For
example in my German environment I need to specify Ü= instead of != and ^=
instead of ¬=.
That's why this specification should be avoided, like special characters
such as @, (§ instead of @ in the German environment), #, $ should be
avoided in the source code.
May be it would be nice to have syntax alternatives in RPG, that means !=
can be used instead of <>, && and || can be used instead of AND and OR or
even *EQ or *NE can be used instead of = and <>. ... But I think it's not
worth to get implemented.
The main problem I see with these alternatives is these special characters
may not be language independent at least not as long as our source code is
not Unicode!
I don't like to type Ü= if I mean !=,
(I recently had to write a program, where the use/programmer can enter some
snippets/conditions in either RPG, CL or Javascript Style and I had to
translate it into the Javascript).
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Scott Klement
Gesendet: Wednesday, 03. March 2010 19:58
An: RPG programming on the IBM i / System i
Betreff: Re: More on RPG style
Hmmm... SQL uses <>, doesn't it? As does BASIC, including Visual
Basic (at least, it did back when I coded in it) as well as CL, right?
At the time that the decision to use <> over != was made, I don't think
anyone realized how popular languages like Java, C# and PHP would make
the != syntax. At the time, there were far more RPG programmers using
languages like VB, SQL and CL than there were RPG programmers using
C/C++. (And Java, PHP, C#, et al didn't yet exist)
On 3/3/2010 12:19 PM, Bryce Martin wrote:
I prefer the C style of != personally. Since almost every other language
I've code in it was !=. RPG is the first one I've seen that is<> which
feels very strange when first starting out coming from C/C++ background.
It makes the code less readable for someone not versed in the language,
maybe some people don't care in that case, but I think its nice to play
well with others :)
As an Amazon Associate we earn from qualifying purchases.