[fpc-devel] for-in-index loop

Paul Ishenin paul.ishenin at gmail.com
Mon Jan 28 14:48:05 CET 2013


28.01.13, 21:27, Mattias Gaertner пишет:

> You are free to not use a feature, but you must understand all when
> using third party code. And the new features are neither easy to
> understand nor to remember.

Already replied to Michael. You don't need to understand third-party 
code the same way as you don't need to understand API sources. For 
winapi and cocoa you don't even have the sources to understand something.

> True.
> But it adds quite a lot of stuff and a simple loop can become much
> slower.

True. Classes adds quite a lot of stuff and simple procedures can become 
much slower. Let's don't use them.

>> I also used types inside classes - this is a great feature. I don't need
>> to polute global namespace with internal types.
>
> True. What about nested classes?

Class is just one of the types pascal have. If for some reason you need 
to use internal class - use it. But in my practive I mostly need some 
enumerations.

>> I would use anonymouse methods in pascal - I use them in javascript when
>> I need to perform something asynchronosly.
>
> Correct me if I'm wrong, but all the alternatives in javascript have
> some drawbacks, you don't write big programs in
> javascript and the anonymous methods easily confuse the javascript
> debuggers.

You can use named methods too wihout drawbacks. Of course one of the 
benefits of anonymouse methods is javascript is access to local 
variables. And I don't notice that chrome debugger is confused much by them.

Best regards,
Paul Ishenin




More information about the fpc-devel mailing list