List:Internals« Previous MessageNext Message »
From:Roy Lyseng Date:March 8 2009 3:18pm
Subject:Re: MySQL University Session: Good Coding Style follow up
View as plain text  
Mointy,

we should probably delay this discussion until the meta-discussions have 
settled, but you raised some concrete questions that need answers :)

Michael Widenius wrote:
> Hi!
> 
>>>>>> "Roy" == Roy Lyseng <Roy.Lyseng@stripped> 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.

The description is too brief: It does not mention placement of switch 
labels and embedded code.

"After switch use a brace on the same line, and do not indent the next 
line."

> 
> 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 ?

All capital letters? Besides, the class name should be more descriptive, 
like Join_operations (this is NOT a proposal). It could also be more 
generic, like Relational_operations.
> 
> 
> Roy> 4. How do we handle "modern" C++ (templates, namespaces, exceptions,...)
> 
> Don't use them in the server code :)
> (Especially templates and exceptions)

Using exceptions is a major change that would need careful consideration.

Templates are already introduced - they need guidelines for when and why.

Namespaces - I think they can be useful in some places - but use with 
care...

Thanks,
Roy
Thread
MySQL University Session: Good Coding Style follow upKonstantin Osipov5 Mar
  • Re: MySQL University Session: Good Coding Style follow upRoy Lyseng5 Mar
    • Re: MySQL University Session: Good Coding Style follow upKonstantin Osipov5 Mar
      • Re: MySQL University Session: Good Coding Style follow upMichael Widenius8 Mar
    • Re: MySQL University Session: Good Coding Style follow upMichael Widenius8 Mar
      • Re: MySQL University Session: Good Coding Style follow upRoy Lyseng8 Mar
        • Re: MySQL University Session: Good Coding Style follow upMichael Widenius9 Mar
          • Re: MySQL University Session: Good Coding Style follow upJay Pipes9 Mar
            • Re: MySQL University Session: Good Coding Style follow upMichael Widenius11 Mar
              • Re: MySQL University Session: Good Coding Style follow upJay Pipes11 Mar
                • Re: MySQL University Session: Good Coding Style follow upMichael Widenius18 Mar
      • Re: MySQL University Session: Good Coding Style follow upStewart Smith17 Mar
  • Re: MySQL University Session: Good Coding Style follow upMARK CALLAGHAN5 Mar
    • Re: MySQL University Session: Good Coding Style follow upIngo Strüwing5 Mar
      • Re: MySQL University Session: Good Coding Style follow upMARK CALLAGHAN5 Mar
        • Re: MySQL University Session: Good Coding Style follow upIngo Strüwing5 Mar
          • Re: MySQL University Session: Good Coding Style follow upMARK CALLAGHAN5 Mar
            • Re: MySQL University Session: Good Coding Style follow upJay Pipes5 Mar
              • Re: MySQL University Session: Good Coding Style follow upMichael Widenius8 Mar
                • Re: MySQL University Session: Good Coding Style follow upJay Pipes8 Mar
            • Re: MySQL University Session: Good Coding Style follow upKonstantin Osipov5 Mar
              • Re: MySQL University Session: Good Coding Style follow upMARK CALLAGHAN5 Mar
              • Re: MySQL University Session: Good Coding Style follow upMichael Widenius8 Mar
    • Re: MySQL University Session: Good Coding Style follow upSergey Petrunia5 Mar
  • Re: MySQL University Session: Good Coding Style follow upDavi Arnaut5 Mar
    • Re: MySQL University Session: Good Coding Style follow upKonstantin Osipov5 Mar
      • Re: MySQL University Session: Good Coding Style follow upDavi Arnaut5 Mar
  • Re: MySQL University Session: Good Coding Style follow upJonas Oreland5 Mar
    • Re: MySQL University Session: Good Coding Style follow upKonstantin Osipov5 Mar
      • Re: MySQL University Session: Good Coding Style follow upJonas Oreland5 Mar
        • Re: MySQL University Session: Good Coding Style follow upshlomo.swidler5 Mar
          • Re: MySQL University Session: Good Coding Style follow upMichael Izioumtchenko5 Mar
        • Re: MySQL University Session: Good Coding Style follow upMichael Izioumtchenko5 Mar
        • Re: MySQL University Session: Good Coding Style follow upStewart Smith17 Mar
      • Re: MySQL University Session: Good Coding Style follow upMichael Widenius8 Mar
Re: MySQL University Session: Good Coding Style follow upKonstantin Osipov5 Mar
  • Re: MySQL University Session: Good Coding Style follow upMARK CALLAGHAN5 Mar
  • Re: MySQL University Session: Good Coding Style follow upMichael Widenius6 Mar
    • Re: MySQL University Session: Good Coding Style follow upKonstantin Osipov6 Mar
      • Re: MySQL University Session: Good Coding Style follow upMARK CALLAGHAN6 Mar
      • Re: MySQL University Session: Good Coding Style follow upMichael Widenius8 Mar