Michael, a question:

How much of the interface section of units differ per platform? Is it 1% of
the code? Is it 5% of the code? With the xml2 unit it's 0%, yet all of the
declarations are nested in several layers of include files:

http://cache.getlazarus.org/images/xml2-unit.gif
http://cache.getlazarus.org/images/xml2-include.gif

At what point does putting every interface declaration a {$i
includemeh.inc} stop making sense?

Okay, so why do I care? Because I want to be able to read what "stuff" is
in a unit by the normal means, and that is to scroll through the
declarations of a unit and not be forced to open 40 or more {$i
includemeh.inc} files. I want to be able to Ctrl+F in a file and find
stuff. I appreciate being able to just read interface declarations to
learn/understand what exactly a unit is declaring. Multiple nested includes
and no real unit interface declarations is to antithetical most all users
ability to learn or understand what is available.

With regards to regions and the RTL, if you for some reason are not using
Lazarus they don't hurt anything. Instead they would act like a comment
saying "Hey, these declarations are implemented in sysint.inc", which has
the same impact as saying {$i sysinth.inc}. The difference is you can
actually read the declarations.

And then there is the LCL, which seems to have borrowed the idea of {$i
includemeh.inc}. The first declarations of the Controls unit does a {$I
controlconsts.inc} and simply lists constant component message identifiers.
Why does this need to be an include file? Put it in the Controls unit
interface section, and if you want throw a region around it as a comment.
You get the added bonus to be able to fold if you're using Lazarus, but if
not, hey you get a nice comment.

I have a feeling that if I ran some analytics on the interface section of
the RTL I would find > 99.5% of the interface section declarations remain
the same across all platforms. I also have the feeling that if an accurate
99.5% analysis was presented here some of you would remain adamant that
unit interface declarations should NOT contain actual interface
declarations, rather multiple nested include files should contain them.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to