"In step 4, never tell the user if it was the username or password they got wrong. Always display a generic message like "Invalid username or password." This prevents attackers from enumerating valid usernames without knowing their passwords. "
Completely, utterly wrong. It 'looks' secure. We're not telling the user if it's a login or password.
But if you try to create an account with the username, it tells you "CANNOT CREATE, USER ALREADY EXISTS".
So, it's an anti-pattern that serves to confuse the user but fails to stop a scripted attack.