Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/package.php on line 78

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Loader::package() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/startup/packages.php on line 8

Strict Standards: Non-static method Object::camelcase() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/loader.php on line 264

Strict Standards: Non-static method Loader::package() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/startup/packages.php on line 8

Strict Standards: Non-static method Object::camelcase() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/loader.php on line 264

Strict Standards: Non-static method Loader::package() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/startup/packages.php on line 8

Strict Standards: Non-static method Object::camelcase() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/loader.php on line 264

Strict Standards: Non-static method Loader::package() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/startup/packages.php on line 8

Strict Standards: Non-static method Object::camelcase() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/loader.php on line 264

Strict Standards: Non-static method User::checkUserForeverCookie() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/startup/user.php on line 4

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/collection_version.php on line 43

Strict Standards: Non-static method UserInfo::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/userinfo.php on line 43

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/userinfo.php on line 95

Strict Standards: Non-static method UserInfo::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/userinfo.php on line 43

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/userinfo.php on line 95

Strict Standards: Declaration of CollectionAttributeKey::getList() should be compatible with AttributeKey::getList($akCategoryHandle, $filters = Array) in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 0

Strict Standards: Declaration of CollectionAttributeKey::add() should be compatible with AttributeKey::add($akCategoryHandle, $type, $args, $pkg = false) in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 0

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/type.php on line 11

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/type.php on line 11

Strict Standards: Declaration of TextareaAttributeTypeController::saveKey() should be compatible with AttributeTypeController::saveKey() in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/types/textarea/controller.php on line 0

Strict Standards: Declaration of TextareaAttributeTypeController::duplicateKey() should be compatible with AttributeTypeController::duplicateKey() in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/types/textarea/controller.php on line 0

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/type.php on line 11

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/type.php on line 11

Strict Standards: Declaration of BooleanAttributeTypeController::saveKey() should be compatible with AttributeTypeController::saveKey() in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/types/boolean/controller.php on line 0

Strict Standards: Declaration of BooleanAttributeTypeController::duplicateKey() should be compatible with AttributeTypeController::duplicateKey() in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/types/boolean/controller.php on line 0

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Cache::set() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 81

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 95

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 97

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 101

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/type.php on line 11

Strict Standards: Declaration of SelectAttributeTypeController::saveKey() should be compatible with AttributeTypeController::saveKey() in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/types/select/controller.php on line 429

Strict Standards: Declaration of SelectAttributeTypeController::duplicateKey() should be compatible with AttributeTypeController::duplicateKey() in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/types/select/controller.php on line 429

Strict Standards: Non-static method Config::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/startup/maintenance_mode_check.php on line 5

Strict Standards: Non-static method PermissionsCache::exists() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/permissions.php on line 69

Strict Standards: Non-static method PermissionsCache::getIdentifier() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/permissions.php on line 15

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/collection_version.php on line 43

Strict Standards: Non-static method Loader::helper() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/startup/process.php on line 29

Strict Standards: Non-static method Object::camelcase() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/loader.php on line 248

Strict Standards: Non-static method View::getInstance() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/dispatcher.php on line 245

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/collection_types.php on line 38

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/collection_types.php on line 40

Strict Standards: Non-static method Cache::set() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/collection_types.php on line 52

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 95

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 97

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 101

Warning: Cannot modify header information - headers already sent by (output started at /home/colinlawrence/colinlawrence.net/concrete/models/package.php:78) in /home/colinlawrence/colinlawrence.net/concrete/libraries/view.php on line 764
Coding Guidelines
Home > Blog > Coding Guidelines

Coding Guidelines


Strict Standards: Non-static method Localization::getTranslate() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/localization.php on line 34
Posted by clawrence on February 16, 2011

Today I had a really good conversation with two of my co-workers about object oriented coding guidelines.  Two guidelines happened to really stick out in the conversation.

First and foremost, never return a null value from a method (or interface).  Returning null values seems to stem from the days when programmers dealt with C code.  This seems to have been the proper way to code back in the day because objects tended to be quite heavy when it came to memory and CPU utilization.  Returning null in object orientated languages causes mistrust in your code because any caller of your method must check for null values before using the returned value.  If the caller doesn't check for null values then an exception will be thrown which will cause a great deal of instability in your application.

Second, if it is possible, wrap primitives in objects.  The tendency that many people have when passing primitive values around in code is assuming something about the primitive in the boundary cases.  This can be thought of as metadata that should be attached along with the primitive value.  There is almost always some kind of metadata that should be attached to primitive values that will help improve your code.  This will help users of your interface (this term is used loosely here) use your value in the correct way.  For example, let's say you pass around a float value that is a lengh value.  Instead of just passing this float value around, wouldn't it be better to also pass along the units of measurement as well, such as metres or feet.


Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/key.php on line 96

Strict Standards: Non-static method Loader::helper() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/key.php on line 103

Strict Standards: Non-static method Object::camelcase() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/loader.php on line 248

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::getLibrary() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 115

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 131

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 112

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 112

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 112

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 112

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/attribute/categories/collection.php on line 73

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 112

Comments:


Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/block.php on line 57

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 112

Strict Standards: Non-static method Loader::db() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/blocks/guestbook/controller.php on line 454

Strict Standards: Non-static method Cache::get() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/models/block.php on line 57

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 111

Strict Standards: Non-static method Cache::key() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/cache.php on line 112

Strict Standards: Only variables should be passed by reference in /home/colinlawrence/colinlawrence.net/concrete/libraries/block_controller.php on line 141

Strict Standards: Non-static method Localization::getTranslate() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/localization.php on line 34
Posted by Conradnef
Strict Standards: Non-static method Localization::getTranslate() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/localization.php on line 34
on
Offering instantaneous pleasure, synthetic hair hair pieces [url=http://wigsforwomenbuy.com/]Wigs For Women[/url]
arrive able to put on. Previously coloured and designed, synthetic locks features just what specialists' describe as 'memory', that means the particular wig retains the design right after becoming [url=http://africanamericanwigs.org/]African American Wigs[/url]
rinsed and thus [url=https://wigsrforwomen.com/]Wigs For Women[/url]
absolutely no hair styling is necessary. Nevertheless, arguably this benefit comes in the worth of flexibility; manufactured head of hair can't be given warmed styling golf irons and it has to get cautiously [url=http://wigsforwomencheap.com/]Wigs[/url]
protected from warmth inside everyday scenarios. Even heat via opening up a cooker might cause damage to your hair dietary fibre; consequently manufactured hairpieces usually degrade more speedily when compared with his or her real hair equivalents. Nevertheless this could not cause [url=http://wigsfor-blackwomen.net/]Wigs[/url]
a challenge to a individual who likes the liberty associated with wearing a number of diverse created hair pieces with regard to unusual [url=http://africanamericanwigs.org/]Wigs[/url]
time periods.

Strict Standards: Non-static method Localization::getTranslate() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/localization.php on line 34
Leave a Reply



(
Strict Standards: Non-static method Localization::getTranslate() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/localization.php on line 34
Your email will not be publicly displayed.)



Strict Standards: Non-static method Localization::getTranslate() should not be called statically in /home/colinlawrence/colinlawrence.net/concrete/libraries/localization.php on line 34
Please type the letters and numbers shown in the image.Captcha Code