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.

Posted in Coding, Design, Poor Error Msg, practice | Tagged , , , , | Leave a comment

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 … Continue reading

Posted in Coding, Example Code, practice | Tagged , , , , | Leave a comment

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.  … Continue reading

Posted in Coding | Tagged , , | Leave a comment