DEV Community

Discussion on: Code Smell 74 - Empty Lines

Collapse
 
tudorhulban profile image
Tudor Hulban • Edited

hi,
the title is misleading. maybe it could be revisited. it covers also the case where you have a 5 lines function and recommends not to use empty lines:

func max(x, y int) int {
    if x > y {
        return x
    }

    return y
}
Enter fullscreen mode Exit fullscreen mode

the empty line provides better readability and should be there.

Collapse
 
mcsee profile image
Maxi Contieri

Hi Tudor
I disagree.
The line does not add readability, and else statement will

Collapse
 
tudorhulban profile image
Tudor Hulban

hi,
no issues.
else is another anti pattern.

Thread Thread
 
mcsee profile image
Maxi Contieri