Primitive Obsession
Brought to you by:
chrismair
From Venkat's "Improving Your Groovy Code Quality" presentation at Spring 2GX (http://agiledeveloper.com/downloads.html) - slide #23
e.g.
def isSpellingCorrect(word) {
File file = new File("...")
def found = false
file.eachLine {
if (it == word) found = true
}
found
}
found is a flag and its a smell
Do you really have to loop through here?