On 12.01.2011, 17:48 Marcos Douglas wrote:

> On Wed, Jan 12, 2011 at 1:18 PM, Alexander Klenin <[email protected]> wrote:
>> On Wed, Jan 12, 2011 at 21:09, Marcos Douglas <[email protected]> wrote:
>>> On Tue, Jan 11, 2011 at 6:03 PM, Hans-Peter Diettrich
>>> <[email protected]> wrote:
>>>> Duplicate identifiers are used in the same unit in very rare cases only, so
>>>> that normally a qualification is not necessary at all.
>>>
>>> Rare cases because I can't use the identifiers TEdit, TButton, etc.
>>> Then we always will have to invent prefixes for new widgets?
>>
>> If you invent a new button, then I guess naming it TButton
>> will be confusing regardless of chosen namespace, since
>> TButton is a well-known name for any Delphi/Lazarus developer.

> Yes, but this was just an example.
> Another example: A while ago I used the prefix "dx", but then I
> discovered that DevExpress.com already using this prefix.
> So, I really would not use TButton or TEdit... but if we want, we could not 
> use?

> I think it's harder to have conflicts with the names of units (but
> they do happen) than with class names.

...  which  you  can  already  do.  The  unit order in the uses clause
already  determines  which  identifier  is  chosen  when  you do *not*
specify  a  unit  explicitly.  So just make sure that LCL's TButton is
always  the  default  one  and  you  can still use your own TButton by
prefixing it with your own unitname. All you want is already there and
seems to cover 99% of the usecases.

--
Andreas Schneider 


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to