[Lazarus] array[0..n] of class of TSomething

Flávio Etrusco flavio.etrusco at gmail.com
Wed Jul 13 11:02:24 CEST 2011


On Wed, Jul 13, 2011 at 6:36 AM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> Flávio Etrusco schrieb:
>
>> Err, why pollute the namespace with an identifier you'll only refer
>> once?
>
> For clarity? Code is not only written for the compiler, but also for human
> readers. Look at the C syntax for type declarations, where some constructs
> are nearly unparsable by humans (without pen and paper).
>
> The name also may be useful in debugging and RTTI, and with every usage of
> an array element in code.
>
> Pascal is a strongly typed language, where e.g. for local variables or
> parameter types a unique type name is a must!
>
> DoDi
>

I agree with on your principles - and your observation on C syntax ;-)
- but disagree this specific case goes against these principles.

Best regards,
Flávio




More information about the Lazarus mailing list