|
On 19-Jul-2016 18:30 -0500, John Yeung wrote:
In most languages, the following code snippet is not a complete,
self-contained statement:
if x > 0
Since it's not a statement, it shouldn't end in a semicolon.
I had the same observation, initially. But I soon, and I must say quite
easily, overcame that feeling\issue I was having with coding the free form
RPG if[-then] construct; [...] so easily overcome,
probably because the following is quite familiar to me, and was already
quite comfortable for me to write:
if (x>0) then do; /* as PL/… is familiar to me */
While in that analogy the observation and implication seems apropos, do
other programming languages that you are thinking of, in contrast, actually
analogize with [the above example of] English punctuated writing? Some
might use bracketing, and that certainly must look just as strange and
non-intuitive from a perspective of a long-term English punctuation user?:
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.