[riot-devel] C++ Style Guide

Hiesgen, Raphael Raphael.Hiesgen at haw-hamburg.de
Thu Jun 25 15:10:44 CEST 2015


Hello,


I created a wiki article [1], which is not linked anywhere yet.

>> How I see it is very similar to RIOT coding style.  2 spaces per indentation
>> level is not acceptable to me, should be 4 as in C coding style. Otherwise,
>> I find it very good.
> 
> +1, indentation must match between the C and C++ coding conventions,
> there will be fewer style mistakes that way.


For the first revision I changed the indentation to 4 spaces and removed the CAF names. Hopefully I found all of them.

> I quite enjoy writing applications in C++ instead of C. The C++
> support is basically just a service to other RIOT users like me who
> like to use C++ for writing their applications.

+1


Raphael


[1] https://github.com/RIOT-OS/RIOT/wiki/Coding-Conventions-C



> On Jun 25, 2015, at 1:18 PM, Joakim Gebart <joakim.gebart at eistec.se> wrote:
> 
> On Thu, Jun 25, 2015 at 11:44 AM, Johann Fischer <j.fischer at phytec.de> wrote:
>> Hi Raphael,
>> 
>> Am 25.06.2015 um 11:09 schrieb Hiesgen, Raphael:
>>> 
>>> Hi,
>>> 
>>> 
>>> it is time to write a C++ Coding Style Guide for RIOT. Since C and C++
>>> have different traditions here, I will simply start to suggest using the C++
>>> Style used in CAF [1]. While it is not identical, the style is relates to
>>> the guidelines used by Google and C++ Standard Library.
>> 
>> 
>> How I see it is very similar to RIOT coding style.  2 spaces per indentation
>> level is not acceptable to me, should be 4 as in C coding style. Otherwise,
>> I find it very good.
> 
> +1, indentation must match between the C and C++ coding conventions,
> there will be fewer style mistakes that way.
> 
>> 
>> By the way, can someone explain to me short why we need C ++ at all?
> 
> I quite enjoy writing applications in C++ instead of C. The C++
> support is basically just a service to other RIOT users like me who
> like to use C++ for writing their applications.
> 
> I don't know if the RIOT community will be open to having RIOT modules
> and device drivers written in C++, (other than the C++ support
> modules, of course).
> 
> Regards,
> Joakim
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel



More information about the devel mailing list