In the code at the bottom of the page, the authors look up the stringValue of the textField:
Then instead of using the string variable, the authors look up the stringValue of the textField again:
else {
println("string is .... \(textField.stringValue)")
}
That’s inefficient. There’s really no reason to declare the variable in the first place because the code will only have to look up the stringValue at most one time–even as the example is modified during the course of the chapter. But in any case, if you want to declare the variable, then use it–don’t keep looking up the same value.