[fpc-devel] Feature announcement: Type helpers

Henry Vermaak henry.vermaak at gmail.com
Wed Feb 6 12:13:33 CET 2013


On Wed, Feb 06, 2013 at 11:52:27AM +0100, Michael Van Canneyt wrote:
> On Wed, 6 Feb 2013, Marco van de Voort wrote:
> 
> >In our previous episode, Michael Van Canneyt said:
> >>>Well, newbies are not to strong in knowing what is which unit either :-)
> >>
> >>If we're talking newbies and IDE:
> >>
> >>They don't need to, if the IDE puts the unit in the uses clause to start with...
> >
> >That's completely new functionality. Afaik most unit adding of IDEs is
> >hardcoded?.
> 
> I know. The codetools need to recognize type helpers in the first
> place.
> 
> Then we can start thinking about changing the default unit uses clause.
> For instance in the package lazarusforeducation or so.
> 
> Anyway, I just wanted to point out which advantages I see (or do not see) in type helpers.

Thanks for pointing out the advantages.  I can see the point, but can't
help to think that I'll be reading code like this soon:

s := '(' + x.ToString + ', ' + y.ToString + ')';

Instead of

s := Format('(%d, %d)', [x, y]);

What I'm trying to say with this (admittedly contrived) example is that
when you are forced to read the docs to find out which functions you can
use for converting numbers to strings, you'll probably discover
functions like Format.  At least in my case, the most useful tricks I
learn come from reading the documentation for something, then exploring
a bit.

I apologise if I come across as overly cynical and I do appreciate
Sven's work in the compiler!

Henry



More information about the fpc-devel mailing list