From 8bdef75d75f991cb89640b8e0e823ecc1c3e9caf Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 11 Mar 2019 18:21:52 -0500 Subject: Add a code style note. --- www/design.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'www') diff --git a/www/design.html b/www/design.html index 707596bc..d1531e87 100644 --- a/www/design.html +++ b/www/design.html @@ -442,6 +442,10 @@ the declaration and the code using it to make you uncomfortable, maybe the function's too big, or is there an if statement or something you can use as an excuse to start a new closer block?

+

An * binds to a variable name not a type name, so space it that way. +(In C "char *a, b;" and "char* a, b;" mean the same thing: "a" is a pointer +but "b" is not. Spacing it the second way is not how C works.)

+

If statments with a single line body go on the same line if the result fits in 80 columns, on a second line if it doesn't. We usually only use curly brackets if we need to, either because the body is multiple lines or -- cgit v1.2.3