Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 491 Bytes

COMPARISON_TEMPLATE.md

File metadata and controls

29 lines (24 loc) · 491 Bytes

actionable name starting with a verb

BEFORE

class Greeter {
    public void greet(String name) {
        // BEGIN
        System.out.println("Hello, " + name + "!");
        // END
    }
}

why this code has an issue in detail

AFTER

class Greeter {
    public void greet(String name) {
        // BEGIN
        var greeting = "Hello, " + name + "!";
        System.out.println(greeting);
        // END
    }
}

why this code is better, can be short