Comprehensive

Written by

in

This page on yarchive.net is an archived 2000-2001 email thread featuring Linus Torvalds (the creator of Linux), Al Viro, and Larry McVoy discussing the Linux kernel coding style, specifically regarding curly brace usage and readability. Key points from this archive include:

The Goal of the Style: The primary objective is readability and maintainability, specifically intended to make it easy to read code quickly, even for “tired old eyes”.

Brace Rules: The discussion emphasizes using curly braces for blocks to ensure that if you see indentation, you know there is a closing brace, reducing errors.

Saving Space: The style aims to keep code compact, which reduces line counts and allows more code to be visible in a single window.

Readability over Line Count: While it saves space, the core argument is that clear formatting makes the code more understandable for developers, rather than just about bragging rights for code size.

This is a classic example of the “Linux coding style” philosophy, which focuses on concise, readable, and strictly formatted C code for the Linux kernel. If you’d like, I can:

Contrast this approach with other common coding styles (like K&R or BSD).

Find the official, updated Linux kernel documentation on this topic.

Summarize other arguments Linus Torvalds has made about coding style in other emails. Let me know if any of these would be helpful.

Coding style (Al Viro; Larry McVoy; Linus Torvalds – Yarchive

b) in all other cases there are curly braces unless (q) return; /OK / unless (q) { / also OK */ return; } unless (q) return; / coding-style.rst – torvalds/linux – GitHub

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *