Guest.Visitor
I use RPG free rarely because there is no compelling reason to do so. Must we murder RPG just to make it "look" like other programming languages. I\'ve switched to RPG IV and I\'ve switched to ILE, somehow "Free" just seems like a lot of effort for nothing.
Guest.Visitor
said:I use RPG free rarely because there is no compelling reason to do so. Must we murder RPG just to make it "look" like other programming languages. That\'s equivalent to saying, "I love the openness and freedom of riding my bike, must I live within the confines of a car to get where I want to go?" There\'s nothing elegant nor intuitive about fixed format RPG. It\'s only good to some because it\'s comfortable like an old t-shirt with holes. Over the years I\'ve learned about 22 programming languages and while fixed format RPG isn\'t my least favorite (I reserve that to assembler language) it\'s near the bottom of the list. Free format, if properly indented, is intuitive and less prone to errors. chuck Opinions expressed are not necessarily those of my employer.
jimmartin
The question of whether to adopt free-format or not is very personal. Some programmers take to it quickly, since it is so much like other free-format languages. Others, especially those who have many years invested in fixed format, feel the same as the first person to comment here. Is it change just for the sake of change? Free-format is a style issue for sure, but there is more to it than that. If you are careful coding free-format, using good field naming, and indenting, and same line commenting, a free-format program is usually easier to read by a maintenance programmer, than its fixed-format counterpart. That\'s what programmers have been telling me. Another point is that free-format does not support the GOTO operation. This requires the programmer to use structured logic, again making the maintenance easier. Some programmers have told me that they like the bigger space for entering expressions. There will always be "arguments" for and against this new style, but it is the style used in all new examples in IBM manuals, and many technical tip authors. Get to know it, try it on a couple of small programs, and check with others at work or in user groups. Follow your company style standards, and continue to grow in your knowledge of this great programming language.
Ralph Daugherty
The semi-colons on the end of every line blew me away. Ugliest syntax I ever saw. At a minimum the semi-colons on the end of block starts (dow, for, etc.) should allow open braces instead of the semi-colon, I wouldn\'t even do it as an option, just allow it, plus require closing brace of course in the compile. Also allow the Java not equal of !=, in other words, should have been Java syntax, folks. No need to reinvent the wheel badly. rd
Guest.Visitor
Hi Ralph, Does it blow you away that in non-free form RPG, you have align factor 1, the opcode and factor 2 in [i>columns[/i>? I\'ll take semi-colons over columns anytime, no problem. I love not having to code KLISTs anymore too. And indenting control structures makes the code very readable in free form. Chris
Guest.Visitor
[i>The data type and length of the fields specified must match the file key(s).[/i> This is incorrect. The [i>length[/i> of the free form fields do not have to match the key fields and the type can vary somewhat if numeric or a native date/time field. In other words, if the key field is 7.0 packed, you can chain with a zoned 6.0. If the key date field is *ISO, you can chain with *USA. The compiler is smart enough to create a intermediate field for you. A field can also be a %BIF, or a return value from a procedure. The disadvantage is you won\'t get a compiler warning on the "mismatch", so you have to test the file I/O thoroughly (we all know how to debug, right?). Chain (Fld1:%Int(MyDecimalNumber)) FileX ; Chain (Fld1:GetSalesLine(SalesOrder:Part)) Filex ; Chris
Ralph Daugherty
Chris, my suggestions concerning semi-colons as equivalent to braces has nothing to do with indentation, etc. When I said it should be Java syntax, that includes indentation. rd
Guest.Visitor
But Ralph... Java syntax requires those same semi-colons too. So, I\'m quite puzzled when you say you want the RPG syntax to be like Java but you don\'t like the RPG semi-colons. Regards, Chris
Ralph Daugherty
I said on the block starts, Chris, open brace allowed for the semi-colon. The other semi-colons would be consistent with other syntax. rd
Guest.Visitor
I got it now Ralph. Thanks for putting up with me! I think it would be strange though not seeing a closing } bracket. And I prefer EndIf, EndDo, EndFor to a } because it makes the code more readable. Chris
Ralph Daugherty
It would be strange, Chris. I had in the post that of course the closing brace would be required in the compile. The END block statement is VB like syntax. Those used to it find braces harder and C and Java style programmers find the END statements to look out of place, I\'m sure. As in my other post, I\'m saying either should compile in /free. Also the == should be accepted for compares. etc. No reason not to accept Java syntax, and plenty of reason to accept it. On a side note, in another thread I said I hadn\'t been getting any spam anymore. Well, this latest Sober worm is generating German spam and lo and behold if I don\'t have one from Chris Ringer. It might just be looking at these posts, I don\'t know. But that\'s just one of many today in the spam catcher. :) rd
Please login to make comments.
User Rating: / 0
PoorBest 

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM