[fpc-devel] for-in-index loop
Michael Van Canneyt
michael at freepascal.org
Mon Jan 28 14:20:07 CET 2013
On Mon, 28 Jan 2013, Paul Ishenin wrote:
> 28.01.13, 20:33, Graeme Geldenhuys пишет:
>> On 01/25/13 08:07, Michael Van Canneyt wrote:
>>> Delphi 7 object pascal could be learned very easily. Nowadays with all the
>>> "features" added
>>> you go, try and explain pascal to someone. Say it is 'nice and readable'.
>>
>> +1
>>
>> Generics, for-in loops, anonymous methods, classes defined inside
>> classes etc... I have and see no need for them, and they simply
>> complicate the beautiful Object Pascal language (at least from the D7
>> days).
>
> Different people see different needs in language. There is nothing bad not to
> use and not understand some of the language features.
tatata, you should always understand everything :)
>
> I used for-in loop many times in my applications simple because it reduce the
> code and therefore makes it more readable.
>
> I also used types inside classes - this is a great feature. I don't need to
> polute global namespace with internal types.
>
> I would use anonymouse methods in pascal - I use them in javascript when I
> need to perform something asynchronosly.
Since you can do the same with simple named methods too,
I see no need for creating the readibility horror that results of it.
> I use avanced record syntax because it makes code more understandable.
It offers nothing that objects didn't already have.
Just trying to say that this is one of these things where Delphi could simply
have re-instated the TP-style objects. The compiler compiled them anyway already.
There was no need to burden records with methods in an attempt to make them 'object-like'.
Michael.
More information about the fpc-devel
mailing list