From 6663709d7679cfbc770665dc01175ac65b6f5c6f Mon Sep 17 00:00:00 2001 From: David Paleino Date: Tue, 2 Feb 2010 19:02:26 +0100 Subject: docs: styleguide, establish line wrapping and $() instead of `` --- doc/styleguide.txt | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/styleguide.txt b/doc/styleguide.txt index 39aedf82..85e1fbb4 100644 --- a/doc/styleguide.txt +++ b/doc/styleguide.txt @@ -37,22 +37,33 @@ be more efficient in some cases and may reduce need for nesting conditions, and it's cleaner to write for example [[ ... && ... ]] than [ ... ] && [ ... ], and in general [[ ]] has more features. +Line wrapping +------------- + +Try to wrap lines at 72 characters. Never go past this limit, unless +you absolutely need to (example: a long sed regular expression, or the +like). This also holds true for the documentation and the testsuite. +Other files, like ChangeLog, or COPYING, are exempt from this rule. + +$(...) vs `...` +--------------- + +When you need to do some code substitution in your completion script, +you *MUST* use the $(...) construct, rather than the `...`. The former +is preferable because anyone, with any keyboard layout, is able to +type it. Backticks aren't always available, without doing strange +key combinations. + ///////////////////////////////////////// case/esac vs if --------------- -line wrapping -------------- - quoting ------- awk vs cut for simple cases --------------------------- -$(...) vs `...` ---------------- - variable and function naming ---------------------------- -- cgit v1.2.1