[Lazarus] Identifier not found, but code completion works....

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Feb 19 17:47:41 CET 2011


On Sat, 19 Feb 2011 11:07:42 -0500
Rich Saunders <saunders.richard.p at gmail.com> wrote:

> On 2/19/11 10:27 AM, Alexander Klenin wrote:
> > 3. The uses section is split, reducing readability.
> > I personally find the opposite -- if properly maintained,
> > the separate "uses" lists are giving reader additional information
> > about unit dependencies and at the same time reduce the amount
> > of dependencies one must scan in order to understand only
> > the unit interface (i. e. to use, not develop, a unit)
> I also find the opposite.
> 
> Using a unit in a uses clause defines the scope of the usage. I think 
> the overriding principle should be to limit the scope to only the code 
> that requires it. Using a unit in the implementation section adds 
> valuable info to the reader that the used unit is NOT needed to define 
> the current unit's interface.

Readability is mostly up to what you are used to. That's why I listed
it as advantage and disadvantage. 
The implementation uses section does not make the code more readable
for everyone. IMHO comments are better suited for that.

It is not the first time that people added implementation uses sections
to the Lazarus code, creating circular dependencies, which lead
weeks/months later to strange errors. And since I'm often the one who
has to fix it I call the implementation uses sections "evil" and I hope
that people will use them only when needed and not only for
"readability".


Mattias




More information about the Lazarus mailing list