[fpc-pascal] Name of a var

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Tue Nov 22 14:09:42 CET 2011



On Tue, 22 Nov 2011, Rainer Stratmann wrote:

>>>> The name of a variable is only used for debugging, and then you can just
>>>> as well use the debug info. And the change of a name is usually done
>>>> with search&replace, option whole word, so the text 'counter' should get
>>>> changed as well.
>>>>
>>>> The name of a variable is of absolutely no use to the end user.
>>>
>>> No that's not correct.
>>> That is in my eyes an excuse not to deal with it.
>>
>> That depends entirely on the cost of this function. For example the use
>> Graeme wants is not possible without adding a complete run-time environment
>> a la .NET.
>>
>>> The search&replace function in lazarus is not the best.
>>> I often change the name in the declaration and then see what the compiler
>>> says. The compiler does not complain with the text 'counter'. So then you
>>> may feel 'secure' but it is not.
>>
>> Once more: the name in the debug message is totally irrelevant.
>> I would fire anyone RELYING on that.
> Are you sure that you are objective in this diskussion?

As much as anyone else in this discussion ? :-)

I just know daily practice; how I and my collegae debug apps. 
I can't for the life of me imagine why you would *rely* on such a feature.

IMHO it adds only very marginal value: in the the case when you rename
a variable, possibly a debug message will not reflect the name change.
How marginal is that ?

Doubly so, because in case the executable contains debug info, you can write
the function yourself so it looks up the name in the debug info.

But hey, if someone wants to implement this, why not. There are other things
in FPC of which I personally do not see the added value...

Michael.



More information about the fpc-pascal mailing list