|
John, In defence of Hans, GOTO is considered, by 90% of professional programmers, to be extremely bad code. IMHO It should be left out. Java doesn't even use it. As for the ";". It wouldn't bother me (I use it in Java). Does anyone see a trend here or is it just me. Is this the RPG of the future? public void subroutine Calc() { int quantity = lineqty(i); float price = quantity * unitprice; } Hmmm reminds me of something! :-) Alistair (20 years programming and still learning new languages!) South Africa -----Original Message----- From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On Behalf Of John Taylor Sent: Thursday, November 02, 2000 11:10 PM To: RPG400-L@midrange.com Subject: Re: Is this the Free-Format that we asked for? For those of you without access to AS400 Network, here is the message posted by Hans that offers the reasoning for this design decision: <Start of Quote> Regarding the GOTO, I had that in the original design, but someone thought that since we were pruning out other stuff that was considered "bad style", GOTO should also be omitted. I agree it can be fine if used correctly, but there are plenty of alternatives: LEAVE, ITER, RETURN, and LEAVESR. By coding reasonably compact procedures and modestly nested loops, the need for a general GOTO is much reduced. Regarding the semicolon, programming languages generally need either a) a syntactical token that ends a statement or b) some indication of statement continuation. Our original design used a + in position 7 to indicate continuation (like the SQL prep), but that design was generally disliked (even though tolerated, at least for a while). Some languages, like REXX or Python require a comma at the end of a line to indicate continuation. Or continuation is implied if an expression is incomplete. But these schemes tend to be a bit confusing. We finally decided that if the semicolon was good enough for PL/I, it would be good enough for RPG, and we went with that. Another consideration is that compilers can generally make more sense of an ill-formed program if the language has some way to synchronize the parse after finding errors. <End of Quote> And here is what I have replied with on the forum thread: Sorry for not responding directly under your post earlier. I presumed that you would just jump in elsewhere in the thread. So let me see if I understand this completely... The GOTO was removed because: 1) Someone on the development team considered it "bad style". The semicolon will be used because: 1) Someone disliked having to code an "+" to continue the occasional multi-line statement. 2) It was good enough for PL/1 (what a resounding commercial success), so RPG might as well use it. 3) This will help the compiler "make sense" of an ill-formed program. I presume in a way that is superior to languages that don't use a semi-colon? Before I continue to waste any more time on this issue, let me first ask you this; has the design been written in stone at this point? In other words, is the purpose of this forum for us to have some impact on what you deliver, or simply to oohhh and aahhh over it after the fact? Regards, John Taylor Canada +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ********************************************************************** +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.