Changes between Version 31 and Version 32 of CodingStyle


Ignore:
Timestamp:
Jul 14, 2018, 6:57:27 PM (6 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodingStyle

    v31 v32  
    99 * If code is repeated, factor it out and make it into a function.
    1010 * If a function becomes longer than 100 lines or so, split it up.
    11  * If a file is becoming 'landfill', split it up.
     11 * If a file is becoming 'landfill' (unrelated stuff), split it up.
    1212 * C++ `.h` files often contain both interface and implementation. Clearly divide these.
    1313
    1414=== Error codes === #error-codes
    1515
    16  * (Almost) all functions should return an integer error code.
    17    Nonzero means error. See [source:boinc/lib/error_numbers.h lib/error_numbers.h] for a list of error codes.
    18    The only exception to this is PHP database access functions, which use the mysql_* convention
     16Most functions should return an integer error code.
     17Nonzero means error. See [source:boinc/lib/error_numbers.h lib/error_numbers.h] for a list of error codes.
     18Exceptions:
     19 * PHP database access functions, which use the mysql_* convention
    1920   that zero means error, and you call mysql_error() or mysql_error_string() to find details.
    20  * Calls to functions that return an error code should check the code.
    21    Generally they should return non-zero on error, e.g.:
     21 * Functions that return whether a condition holds; such functions should have
     22   descriptive names like `is_job_finished()`.
     23 * Functions that return a number or other type, and for which no errors are possible.
     24
     25Calls to functions that return an error code should check the code.
     26Generally they should return non-zero on error, e.g.:
    2227{{{
    2328retval = blah();