/[http://wiki.kde.org/tiki-index.php?page=KDE+Community+World+Summit|aKademy] / [http://wiki.kde.org/tiki-index.php?page=Talks+@+aKademy|Talks] / Common Code Patterns -=Common Code Patterns, Helio deCastro and Gustavo Boiko=- To share code it can be moved to a core shared library, to a system library or a separate library (but may be too small for a separate library). However code is sometimes duplicated e.g. to allow improvements. If code is already duplicated there are problems when fixing incorrect code because it's not synchronised. Can't reflect system changes in all implementations. Code can be duplicated inside an application, take it from one application and put it in another. So proposal is for a common code patterns repository. Have a repository of common functions guarded by a namespace. Use is simple by just including the CCP, Common Code Pattern, file. This is an example template, and a problem that they had which had duplicated code. namespace CCP{ int GetProcNumber() { /*get number of processors*/ } } Use by: #include Advantages are multiplatform, easy to fix, less build system problems. This is a new proposal based on mature concepts, other projects may adopt this concept.