[fpc-devel] for-in-index loop

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jan 28 14:27:34 CET 2013


On Mon, 28 Jan 2013 21:02:23 +0800
Paul Ishenin <paul.ishenin at gmail.com> 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.

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.

 
> I used for-in loop many times in my applications simple because it 
> reduce the code and therefore makes it more readable.

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

 
> 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?

 
> 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.

 
> I use avanced record syntax because it makes code more understandable.

This feature made records more consistent with objects and classes, so
I would say they indeed made Pascal easier to understand.

 
> I scarry to use generics but that simple because they have many bugs.


Mattias



More information about the fpc-devel mailing list