[fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

Michalis Kamburelis michalis.kambi at gmail.com
Tue Jun 21 09:10:05 CEST 2016


2016-06-20 11:44 GMT+02:00 Mark Morgan Lloyd
<markMLl.fpc-pascal at telemetry.co.uk>:
[...]
> I'd suggest warning readers early about "dangling else", and using otherwise
> rather than  else  in the  case  examples.

As for dangling else - good idea, I added a text and example
mentioning it briefly at the of
http://michalis.ii.uni.wroc.pl/~michalis/modern_pascal_introduction/modern_pascal_introduction.html#_testing_if
.

As for "otherwise" in "case" - I admit I prefer the "else" keyword
there. Although I don't have any other argument for it than being
accustomed to it, from reading existing sources. I just grepped FPC
and Lazarus source code, and I couldn't find any "case" with
"otherwise" section... while I easily found occurrences of "case" with
"else" sections.

For this reason, I am inclined to keep the example with "case ..
else", not "case .. otherwise". Indeed, one needs to be more careful
then (to not mix the "else" with an "if" from the last statement).

> It's unfortunate that there's a lot of C programmers who wouldn't dream of
> writing in K&R, but who still assume that Pascal is still as primitive as it
> was in the 1970s.

That's a great analogy. I may steal it some day:)

>
> There's a few places where a native English author would have done things a
> bit differently. For example, in most places "Castle Game Engine" would
> probably be prefixed by "the", and also "it allows [something, what] to deal
> with cases when simple class inheritance is not enough".
>

Thanks! I improved it a bit, adding "the" at some places and changed
to sentence to simpler "Useful when a simple class inheritance is not
enough.".

I'm not a native English speaker, so any corrections and suggestions
are very welcome when it comes to the language (and everything else:)

Regards,
Michalis



More information about the fpc-pascal mailing list