From: Michael Widenius Date: June 24 2009 3:14pm Subject: Re: MySql coding style: Request for deprecation of UPPERCASE typedefs List-Archive: http://lists.mysql.com/internals/36988 Message-Id: <19010.17083.613290.646533@narttu.askmonty.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! >>>>> "Tor" == Tor Didriksen writes: >> class Table_ident; /* Need to be before include of sql_yacc.h */ >> class Item_num; >> class String; >> class Key_part_spec; >> struct TABLE_LIST; >> typedef struct st_udf_func udf_func; >> typedef struct st_lex_user LEX_USER; >> #include "sql_list.h" /* Pull in List<> */ >> #include "set_var.h" /* Pull in sys_var_with_base */ >> #include "sql_yacc.h" /* Pull in symbol definitions */ >> >> For each line, I had to do a symbol search to find the definition of it >> and see >> how and where it was defined. Most other files have similar >> dependencies... >> >> /Matz Tor> wow! Tor> Each header file should have been self-contained of course, there should Tor> be no need for forward declarations before #include There is no 'of course' in that. If you try to do every include file self-contained, you need a LOT of more includes 'just in case' and dependents that just creates more code, more parsing without giving you anything. MySQL was design with the idea that you in most cases only have to include one (but in practice a few) include files in each source file. 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 headers. - Easier to handle header files with conditionals as you are less likely to include these before all the required definitions are defined. Regards, Monty