From adff5ef28f8763c70aa24071940f4c3df4a5cc3a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 16 Nov 2009 10:52:27 +0100 Subject: README.Coding: add section about usage of helper variables metze --- README.Coding | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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()); + ... + -- cgit v1.2.1