Refactoring

Dead code

4 minute read

Dead code is a code smell. Dead code is code that has remained around but is never reached or called. It is very common to have dead code in older projects t...

Large class

6 minute read

A large class is a code smell very similar to a long method. Some might argue that a lot of small classes make the code harder to follow. However, the exact ...

Avoiding unnecessary null checks

9 minute read

The most common reason for writing null checks is that you run into a null pointer exception. The second most common reason is that you happened to think abo...

How to prevent legacy code from emerging

5 minute read

Every software developer has faced the situation. You have been assigned a task to add or change a feature. You know nothing about the particular feature but...

Code comments

6 minute read

Code comments are a code smell. This statement might feel contrary to reason when you have been taught to always comment your code. Having comments might how...

Primitive obsession

6 minute read

Primitive obsession is a code smell. Primitive in this context refers to programming language primitive data types. Obsession refers to always using these da...

Switch statements

11 minute read

Switch statements are a code smell. Complex conditionals can be hard to read. The same pattern of switch statements might be repeating in several locations.

Long method

6 minute read

A long method is a code smell. It is a well known fact that the longer a method is, the harder it is to understand. Smaller methods might be harder to follow...

Long parameter list

5 minute read

Long parameter list in a method call is a code smell. It indicates that there might be something wrong with the implementation.