Michael Widenius wrote:
>>>>>> "Mats" == Mats Kindahl <mats@stripped> writes:
>>> The benefit of this is:
>>> - Easier to decide what to include
>>> - Faster compile time for all compilers
>>> - MUCH faster compile time for compilers that support precompiled
>>> - Easier to handle header files with conditionals as you are less
>>> likely to include these before all the required definitions are
> Mats> I think a coding policy that optimizes for minimization of includes and
> Mats> speed is not focusing on the right things.
> Actually, it also gives you fewer errors and makes it easier to start
> coding a new project file (this is from experience with the MySQL projects)
You ARE kidding, right? When is the last time you counted the number of
warnings emitted during a standard build of MySQL?
By splitting class declarations into appropriately-named headers, and
only including in an implementation file the headers needed for
compiling the code in that file, you *make the code and file structure
clearer*. This clarity enables more people to become familiar with how
the classes, files and directories are structured simply by looking at
the file organization. If you want proof of this, ask any Drizzle
contributor who has worked on both the MySQL and the Drizzle code bases.
> Mats> Also, for the current code, deciding what to include is not very easy since
> Mats> header files are dependent on other header files being included before they
> Mats> included.
> In most cases, one only have to include a few files (in many cases
> just one) and there is lost of examples, so this isn't a big thing.
> Allowing things to be included in any order, will force you to have
> massive include directives in the include files and is an even worse
> practice and harder to maintain.
When you state things like "even worse practice" and "harder to
maintain", you are not giving any hard evidence to back up those claims.
This makes it look like you are just not willing to acknowledge a
difference of opinion in these long-standing issues in the MySQL code
base. This is a shame, Monty.