From: Joerg Bruehe Date: September 24 2010 7:33am Subject: Re: [STYLE] could we allow // for comments alone on their line? List-Archive: http://lists.mysql.com/internals/38112 Message-Id: <4C9C543F.1030600@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Hi Guilhem, all! To me, your question has both a style and a technical aspect. Guilhem Bichot wrote: > [[...]] >=20 > So the proposal is merely to allow > // this is a comment which is alone on its line > in C++ code. > I'm fine if we continue forbidding > // this is > // a multi-line > // comment > and require /* */ instead. >=20 My technical comment on "//": The increased use of "//" comments in C++ files raises the risk of using them in C files, which will not be rejected by most C compilers (including gcc) but will cause compilation failures with IBM C (which we use on AIX and i5/os). We have had several release builds fail because of this, it is simply detected too late. So the build team has to fix it, push, and start a rebuild. Considering that AIX and i5os are not our fastest platforms and that we might not detect the failure immediately, the delay may be significant. I would prefer not to use "//" at all, just to avoid that it might become a habit which then affects C files. My style comment (includes technical reasoning): For multi-line comments, my preference would be /* * the real comment * maybe several lines */ so that a commented code line returned by "grep" does not look like active code. (I have been bitten several times by this when checking MySQL code: a variable looked like being used when in fact all use was already turned into comments.) However, this style differs from current MySQL conventions so I will not pursue this myself (but would support others who feel similar). Regards, J=F6rg --=20 Joerg Bruehe, MySQL Build Team, joerg.bruehe@stripped (+49 30) 417 01 487 ORACLE Deutschland B.V. & Co. KG, Komturstrasse 18a, D-12099 Berlin Geschaeftsfuehrer: Juergen Kunz, Marcel v.d. Molen, Alexander v.d. Ven Amtsgericht Muenchen: HRA 95603