[Kst] extragear/graphics/kst/devel-docs

George Staikos staikos at kde.org
Wed Oct 26 05:48:16 CEST 2005

SVN commit 474328 by staikos:

methods that pass multiple return values via reference are banned.  They're too
error-prone and lead to confusion and hard-to-trace bugs.

 M  +6 -0      codingstyle.txt  

--- trunk/extragear/graphics/kst/devel-docs/codingstyle.txt #474327:474328
@@ -139,6 +139,12 @@
 - If you fix a bug for code that has substantial testing support in tests/, you
   must add a testcase to avoid regressions in the future.
+- Methods and functions that return their values through references are
+  -banned-.  Do not add these as new code, and try to clean up old ones as you
+  go.  If you must return multiple values individually, use a pointer.  It's
+  too confusing to use references and leads to many hard-to-trace bugs.  Ideally
+  use a single structure/class to encapsulate the data and return.
 - Why do we do this?  To make coding on Kst faster, easier, more consistent,
   and more efficient.

More information about the Kst mailing list