Re: Optional "then" and "do"

new topic     » goto parent     » topic index » view thread      » older message » newer message

Keep in mind, syntax errors (missing and, missing then, missing do) are much 
easier to find and fix than logic errors (variable being assigned value 1
instead of testing for value 1).

This feature should only be allowed by a without header, making then and do
still required by default.

In other words, if the programs starts,
without thendo


and later you see
if a = 1
   b = 2
   c = 3
end if


a will be tested, b will be assigned, and c will be assigned.  
If the intention was to test b, there will be a logic error that won't appear
until much later in the execution.

On the other hand, if the without thendo statement is missing, this code
will immediately terminate before execution with an error that something is
missing, pointing directly to this line in the program, and creating an
ex.err file.  Even though I think it's a hassle to always type then and do,
I would much rather be forced to do that knowing that I won't have any logic
errors because of a missing and/or/then than have to spend several hours 
trying to hunt down why my program isn't working the way it's supposed to.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu