RSS

Prefer JSON over XML for Data Structures

If you are going to exchange data structures between programs you have many choices.  Of these, JSON is the best choice in general, and specifically a better choice than XML, and this post explains why. Read the rest of this entry »

 
Leave a comment

Posted by on June 1, 2016 in Design

 

Tags: , ,

Avoid Unnecessary Conditional Nesting

Simply put: try to make your conditions as flat as possible.  This makes them generally easier for the humans to parse and understand.  Read the rest of this entry »

 
Leave a comment

Posted by on March 29, 2016 in Coding, practice

 

Tags: , ,

Individual Exception Classes are Monstrously Overweight

My last post was you can avoid a lot of waste in a project by recognizing program logic errors, and keeping the exception being thrown very lightweight. In this post I talk about a particularly heavy exception, the individual exception class, which is constructed to communicate just one thing. They are just too heave for most use, and here is why. Read the rest of this entry »

 
Leave a comment

Posted by on March 16, 2016 in Uncategorized

 

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: , , , ,

Resetting Passwords the Right Way

Never send a password through the email. There is never any need to do so. If your program does this for any reason, it is not following the best practice. Read the rest of this entry »

 
Leave a comment

Posted by on March 10, 2016 in Uncategorized

 

Constant Abuse

Constants can be useful, but constants can also be abused making code hard to read because you always have to go look somewhere else in the code just to understand what you are reading. This post is about a clear example of how constants can be used to make code much harder to maintain, particularly when they are arbitrary symbolic representations of something that is already supposed to act as a constant symbolic value. Read the rest of this entry »

 
Leave a comment

Posted by on March 9, 2016 in Uncategorized

 

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: , , , ,

 
Follow

Get every new post delivered to your Inbox.