Code Smell of the Week, Design Patterns

Code Smell of the Week : Magic Numbers

if(order.getStatus() != 1)
{
 ordersList.add(order);
}
displayOrders(ordersList);

First look at this code tells you that an order with a particular status is not displayed. But what is that particular status ? When is it changed ? Who the hell wrote this ? These are the frustrating questions that pop-up in the programmers head. What follows is a quest to find the creator of the code by navigating the Maze (a.k.a. The Code Repository). The creator may also have ‘moved on’ which leads to further pain.

Continue reading

Standard