Slide 28
Slide 28 text
linguistic anti-patterns cause confusion
var elements = retrieveElements();
private Product retrieveElements() {
return products.last();
}
What do you think when you read this ?
• Think of information on functions returning a list of things
• Gives you the idea you could sort, filter, or slice the returning element
isValid What do you think when you read this ?
Lead to mischunking
• Assume the variable is a Boolean
• No need for your brain to dig deeper
• By trying to save energy, your brain has made a wrong assumption