[Lazarus] "Figures" in code explorer

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Apr 19 13:02:28 CEST 2009


On Sun, 19 Apr 2009 20:28:31 +1100
Alexander Klenin <klenin at gmail.com> wrote:

> New "figures" feature is an excellent addition, thanks Paul and
> Mattias!
> 
> It already motivated be to fix some stylistic problems in one of my
> projects ;-)
> 
> A few questions/suggestions for improvement:
> 1) Where did the name came from? It is totally meaningless for me.

See
http://www.askoxford.com/concise_oed/figure?view=uk

>   Maybe 'Stylistic notes' or 'Style' or something along these lines?

Not all are about style.


> 2) What is wrong with published properties without default?

See
http://wiki.freepascal.org/User_Changes_2.2.4#Default_property_values

If a property is streamed without need it 
1. increases the size of the lfm
2. makes updating error prone, because even useless properties are
streamed. For example if a property was introduced and later
removed/renamed it is still in the lfm and the compiler does not notice.

The LCL had the last case a few times in the last years and every time
you have to check all lfm files. Therefore the LCL has a built in list
of ignored properties.

 
> 3) I also like that codeexplorer options are now integrated with the
> common dialog, however:
> 3a) Maybe 'Enable figures' checkbox should be moved to or duplicated
> on the 'Figures' page?

Yes. But I'm biased about duplicate or move.

> 3b) Maybe option 'parameters', lice line/procedure counts, should be
> placed near the corresponding checkboxes?
> 3c) What is the reason for 'search char constants' option? I think it
> should just be always on.

IMO char constants like #10, #13, 'a' or ' ' don't need to be
listed.


> 3d) I think '' (empty string) should be added to the default list of
> ignored constants.

IMO no one wants to see empty string constants in this list, so no
need for an option.

 
> 4) A few wishes/feature requests:
> 4a) 'Empty procedures' should not trigger if the procedure has comment
> in the body,
>   to take care of a common idiom:
>   procedure TMyClass.Proc;
>   begin
>     // do noting
>   end;

The figures are hints, not warnings.
I already found with this feature some empty methods with comments that
were useless and could be removed.


> 4b) Add 'Unsorted procedures' similar to 'unsorted members'

I rarely have seen units where all procedure are sorted alphabetically.
Same for enums, types, variables and constants.


> 4c) Add 'Empty begin..end' block, probably with the same check for the
> comments as in (4a)
> 4d) Add 'Single statement in begin..end block'
> 4e) Add 'Too many nesting statements' and 'Too many nesting
> procedures' 
> 4f) Add 'Line loo long' with default limit of perhaps 80
> or 90 characters. 
> 4g) Add 'Incorrect indentation' for the cases where
> indentation does not correctly represent
>   statement nesting.

Are you joking or are you a grammar nazi?


> 4h) Add 'Fixme' similar to 'TODO'

AFAIK the todo list is not yet customizable. If you extend it, the code
explorer will be extended too.


> 4i) This is probably an unrelated issue, but 'TODO' is only recognized
> inside multi-line {} comments,
>   not inside single-line (//) ones.

Fixed.

Mattias



More information about the Lazarus mailing list