From: Michael Widenius Date: March 9 2009 11:17am Subject: Re: MySQL University Session: Good Coding Style follow up List-Archive: http://lists.mysql.com/internals/36370 Message-Id: <18868.64172.70309.914386@narttu.askmonty.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi! >>>>> "Roy" == Roy Lyseng writes: Roy> Mointy, Roy> we should probably delay this discussion until the meta-discussions have Roy> settled, but you raised some concrete questions that need answers :) Roy> Michael Widenius wrote: >> Hi! >> >>>>>>> "Roy" == Roy Lyseng writes: >> Roy> Kostja, Roy> thanks for bringing this up! >> Roy> I can raise a few issues: >> Roy> 1. switch style should be more specific. (I saw 4 different styles on a Roy> brief scan of sql_select.cc). >> >> THere is only one style. However it's not enforced. Roy> The description is too brief: It does not mention placement of switch Roy> labels and embedded code. Roy> "After switch use a brace on the same line, and do not indent the next Roy> line." The emacs rules that are part of the description handles that. But I agree that should be cleary defined in text too. >> In the 'perfect' world we could have a script that fixes the style on >> or before commit to get rid of this problem. >> >> We have an old script, but it only works to 95 %; Not good enough to >> be truested for automatic fixing... >> Roy> 2. "space" advice for bitwise operators missing. >> >> Agree >> Roy> 3. How does class JOIN fit into the coding rules? >> >> Can you explain ? Roy> All capital letters? Besides, the class name should be more descriptive, Roy> like Join_operations (this is NOT a proposal). It could also be more Roy> generic, like Relational_operations. Yes, it should be made more descriptive. Same with THD. Roy> 4. How do we handle "modern" C++ (templates, namespaces, exceptions,...) >> >> Don't use them in the server code :) >> (Especially templates and exceptions) Roy> Using exceptions is a major change that would need careful consideration. Agree. Roy> Templates are already introduced - they need guidelines for when and why. Templates are fine to use as long as they are used only to remove casts in the code, not to generate code. Roy> Namespaces - I think they can be useful in some places - but use with Roy> care... Agree. Regards, Monty