3 ms·
The Linux kernel has a code style with 8 spaces and still has the 80 characters maximum. The coding style says "if you need more than 3 levels of indentation, y
by samuellb 10y ago
The Linux kernel has a code style with 8 spaces and still has the 80 characters maximum. The coding style says "if you need
more than 3 levels of indentation, you're screwed anyway, and should fix your program.". So not everybody agrees that you need deep indentation.
https://www.kernel.org/doc/Documentation/CodingStyle https://www.kernel.org/doc/Documentation/CodingStyle
- nikolay 10y agoThe kernel is in C. In OOP, there's at least one level coming from class declarations. 3 levels are more than normal in OOP!
- samuellb 10y agoThat's true. And in the OOP case you usually have exception handling (i.e. try/catch blocks) as well, instead of "goto error" style error handling which is common in C.