[fpc-devel] Should TObject or TComponent have a Comment property?

Sven Barth pascaldragon at googlemail.com
Fri Jul 12 20:19:37 CEST 2013


On 11.07.2013 22:22, vfclists . wrote:
> Should TObject or TComponent have a Comment property?
>
> I think they should. One for the design itself and one for describing
> the usage at design or runtime.
>
> Smalltalk has it.
>
> Consider it a version of the Hint property but for the developer

I don't consider this a good idea. Properties can only be filled in the 
implementation section or using resources (e.g. LFMs) (I ignore the 
"default" modifier for now).

If you want comments for classes, properties, etc. then use attributes 
(once the branch is merged to trunk):

=== code begin ===

type
   [TComment('This class does something really awesome')]
   TMyClass = class
     [TComment('This property does this and that')]
     property SomeProperty: ...
   end;

=== code end ===

(this might be the only case were I'd consider the attributes *before* 
an identifier advantagous)

Regards,
Sven



More information about the fpc-devel mailing list