summaryrefslogtreecommitdiff
path: root/README.Coding
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-11-16 10:52:27 +0100
committerStefan Metzmacher <metze@samba.org>2009-11-16 10:52:27 +0100
commitadff5ef28f8763c70aa24071940f4c3df4a5cc3a (patch)
tree70c5378a1a35d65b50cd28f9a3ed9e41ab654498 /README.Coding
parent6c6c8e91efb8a534afb629897b402bf3f3945948 (diff)
downloadsamba-adff5ef28f8763c70aa24071940f4c3df4a5cc3a.tar.gz
README.Coding: add section about usage of helper variables
metze
Diffstat (limited to 'README.Coding')
-rw-r--r--README.Coding26
1 files changed, 26 insertions, 0 deletions
diff --git a/README.Coding b/README.Coding
index 3b7266e3172..ae09349d336 100644
--- a/README.Coding
+++ b/README.Coding
@@ -241,3 +241,29 @@ Typedefs
Samba tries to avoid "typedef struct { .. } x_t;", we always use
"struct x { .. };". We know there are still those typedefs in the code,
but for new code, please don't do that.
+
+Make use of helper variables
+----------------------------
+
+Please try to avoid passing function calls as function parameters
+in new code. This makes the code much easier to read and
+it's also easier to use the "step" command within gdb.
+
+Good Example::
+
+ char *name;
+
+ name = get_some_name();
+ if (name == NULL) {
+ ...
+ }
+
+ ret = some_function_my_name(name);
+ ...
+
+
+Bad Example::
+
+ ret = some_function_my_name(get_some_name());
+ ...
+