General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Mikko Rantalainen
Low Level
comments
Comments by "Mikko Rantalainen" (@MikkoRantalainen) on "how Google writes gorgeous C++" video.
I think that if you don't use RAII and exceptions, you shouldn't bother with C++ at all. Just use modern C. Yes, that requires writing wrapper code for all incorrectly (that is, without RAII and exceptions) written C++ code.
8
I definitely don't agree with indenting code with spaces. My rule is simple: at the start of line, only tabs are allowed as the whitespace and after first non-tab character, no tabs are allowed at all. This allows every engineer to set their tab width just like they want it and the code still has identical logical indention for every engineer. If a line must be indented two levels, it has two tabs. And if the engineer wants to see it as 4, 6, 8, or 16 character wide indentation, they can adjust their editor as they like it.
2
@valizeth4073 C23 standard is being specified this year – what do you consider "modern"?
1
I personally use Allman-8 style with tabs for indentation and that's also the style most typically used to teach programming because it's the most clear style there is. Why would you want to use less clear style for "professional" code? I've been writing Allman-8 style for 20 years professionally and it's not a problem for "too wide" indentation. And I use tabs for indentation so colleagues that like less indentation can do that just fine. Just configure your editor to highlight any spaces at the start of the line in red or use a linter in your build routine to report and error if even a single space is used to indent any code.
1
I personally use Allman-8 style with tabs for indentation and that's also the style most typically used to teach programming because it's the most clear style there is. Why would you want to use less clear style for "professional" code? I've been writing Allman-8 style for 20 years professionally and it's not a problem for "too wide" indentation. And I use tabs for indentation so colleagues that like less indentation can do that just fine. Just configure your editor to highlight any spaces at the start of the line in red or use a linter in your build routine to report and error if even a single space is used to indent any code.
1