[fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

vfclists . vfclists at gmail.com
Tue Jul 16 23:56:33 CEST 2013


On 15 July 2013 22:58, Kenneth Cochran <kenneth.cochran at gmail.com> wrote:

>
>
>
> I completely disagree. It is the code that is the primary expression of
> intent not the comments. This is mainly accomplished through sensible
> identifier naming. Comments exist to compensate for a developer's inability
> to express intent through the code and IMHO should be reserved for this
> sole purpose. In most cases you should be able to look at a function
> signature and know exactly what that function's intent is. Likewise you
> should be able to tell the intent of a class by its name and the names of
> its public/published members. This is, at least, what I strive for in my
> own code. Bob Martin's "Clean Code" dedicates the entire 4th chapter to the
> discussion of comments and make some very compelling arguments for limiting
> their use.
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>

I have 2 main concerns here, a comment for the component itself which is
not particularly important and a comment for the component when I add it to
a form or data module. When I create a method I can add a comment to the
method. If I create a component in code, I can label that section of code,
but if I drag and drop a component from the palette onto the form what
option do I have?  Descriptive variable and component names have a habit of
getting too long. It is hardly for the end users sake unless the enduser is
a programmer. I just need something to help when working in the IDE, eg
hovering over a component and seeing the comment in addition to what is
current displayed.

-- 
Frank Church

=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130716/dcd991f4/attachment.html>


More information about the fpc-pascal mailing list