RSS

Tag Archives: code style

Two Kinds of Exceptions

An exception is a message from the system to the user about something that the program can not handle. There are a couple of main categories of exceptions: environmental and program logic. They warrant quite different treatment. Read the rest of this entry »

 
Leave a comment

Posted by on March 14, 2016 in Coding, Design, Poor Error Msg, practice

 

Tags: , , , ,

Brainless Getters & Setters are a Waste

Someone long ago set a pattern that all members should have a getter and setter method.  Some are persuaded that this is OO and this is encapsulation, so a lot of inexperienced programmers do this by default.  But this is a problem. Read the rest of this entry »

 
Leave a comment

Posted by on March 7, 2016 in Coding, Example Code, practice

 

Tags: , , , ,

Always use a brace even if not needed

In C, C++, Java, and other languages, you use curley-braces — ‘{‘ and ‘}’ — to indicate the start and the end of a block of code.  However, the braces are optional if the block is only a single line.  This is an option you should never use.  Always use the brace, even if it is a single line. Read the rest of this entry »

 
Leave a comment

Posted by on June 14, 2013 in Coding

 

Tags: , ,