[fpc-devel] Feature announcement: Type helpers

Sven Barth pascaldragon at googlemail.com
Wed Feb 6 13:12:59 CET 2013


Am 06.02.2013 12:13, schrieb Henry Vermaak:
> 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]);
I suppose there are quite some people (especially newbies ^^) who write 
it like this:

s := '(' + IntToStr(x) + ', ' + IntToStr(y) + ')';

And here I would prefer the "ToString" variant (but my personal favorit 
is the "Format" one :) )

Regards,
Sven



More information about the fpc-devel mailing list