[fpc-devel] Fwd: While - Otherwise Statement

Michael Van Canneyt michael at freepascal.org
Tue Oct 13 23:25:03 CEST 2015



On Tue, 13 Oct 2015, Martin Frb wrote:

> wkitty42 at windstream.net wrote:
>>> ahhhh... my bad... sorry 'bout that... i've been thinking about this, 
>>> too... 'else' and 'otherwise' mean the same thing... what they seem to be 
>>> looking for is 'aswell'...
>>> 
>>> 
>>> foo := 0;
>>> while foo < 100 do
>>>   begin
>>>     inc(foo);
>>>   end;
>>> aswell
>>>   begin
>>>     dec(foo);
>>>   end;
>>> 
>>> 
>>> either 'aswell' or 'aswellas'... while foo is less than 100 increment foo 
>>> as well as decrement foo when it is no longer less than 100...
>> 
>
> I am not native English, but aswell to me implies "do both" and gives no 
> order.
> So I would expect this (the aswell block) to be executed for each iteration 
> too. like the perl continue block 
> http://perldoc.perl.org/functions/continue.html
>
> btw, while I am not for it, the continue block appears much more useful than 
> the "on-none-break" block. Though the continue block is not really ever 
> needed, usually you can write the loop with the counter decrement at the top.
>
> But the existence of such a continue block shows the fundamental issue on 
> which a decision is needed. should (if a volunteer for a patch exists) every 
> little "save one statement in your code helper" be added? Because there are 
> thousands of them, and if you add them all the readability of code will go 
> down, because you need to first learn them all.

I think the answer to your question is a clear and loud "NO".

The argument that we can refrain from using these new features does not hold,
because other people will be using it, and we will have to know all of it to 
be able to understand their code.
None of these features will automagically make Object Pascal a popular language.

However, I seem to be one of the very few thinking this given the enthousiasm with 
which people are discussing this.

Soon I will be forced to emigrate to Javascript country. 
Despite all its drawbacks, it remains at least a simple language. 
a dozen keywords and you're done. No wonder Node.js is so popular.
Compare that with the jungle we're making of it... :(

Michael.



More information about the fpc-devel mailing list