Hacker News new | ask | show | jobs
by ApostleMatthew 3100 days ago
I'm relatively new to C++, is this style common? I refer to, for example, putting the return of function on a separate line from the name and each of the passed parameters on a separate line as well.
2 comments

For C++, I subscribe to Google style. It addresses this.

https://google.github.io/styleguide/cppguide.html#Function_D...

Geez how does anyone remember all of that...
Your linter remembers for you.
Indeed, the very best kind of coding convention is the automated and enforced kind. Prevents a lot of arguing, leaving more time to argue about the code's actual contents.
That’s a core challenge of writing code in a language as large and complicated and dangerous and rewarding as cpp.
There is no common style in C or C++. This is a free for all area, even with clang format.