diff --git a/HACKING b/HACKING index c3dc10e4..a30bb527 100644 --- a/HACKING +++ b/HACKING @@ -8,13 +8,13 @@ Coding Style Examples: BAD: - ``if(a)`` + ``if (a)`` BAD: - ``if(a!=NULL)`` + ``if (a!=NULL)`` GOOD: - ``if(a != NULL)`` + ``if (a != NULL)`` GOOD: - ``if(a != 0)`` + ``if (a != 0)`` - Put figure brackets ``{}`` even if you have only one operator in ``if``, ``for``, etc. This also makes code easier to read and @@ -24,12 +24,29 @@ Coding Style BAD: .. line-block:: - if(a != NULL) + if (a != NULL) message(G_LOG_LEVEL_MESSAGE, "Ko"); GOOD: .. line-block:: - if(a != NULL) { + if (a != NULL) { + message(G_LOG_LEVEL_MESSAGE, "Ok"); + } + +- Put SPACES before the opening round bracket and after the closing round + bracket. One more time, it improves the readability of the code. + + Examples: + BAD: + .. line-block:: + + if(a != NULL){ + message(G_LOG_LEVEL_MESSAGE, "Ko"); + } + GOOD: + .. line-block:: + + if (a != NULL) { message(G_LOG_LEVEL_MESSAGE, "Ok"); } @@ -42,4 +59,3 @@ Coding Style ``return(0);`` - Check for memory leaks. -