Hacker News new | ask | show | jobs
by samuellb 3683 days 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

1 comments

The kernel is in C. In OOP, there's at least one level coming from class declarations. 3 levels are more than normal in OOP!
That'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.