One of the things I have learnt is code review should never start with looking at what the code does or even how it does it. Take this snippet for example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
public class Highlander { | |
void hello_World() { | |
System.out.print("There can only be one!"); | |
} | |
} |
- The insane mixture of camelCase and underscores
- A curious use of the package-private visibility
- Rather disturbing presence of the Singleton annotation
Whilst all these questions are very valid, without proper context they may prove to be completely redundant! Building up this context is where a code review should start, establish:
- Why is the code needed?
- What is the underlying problem being solved?