I've yet to see a case where the user wasn't warned beforehand, unless it was blatant spam. The usual scenario is this:
User says something inappropriate.
Mod gives them a warning.
User disrespects mod/ignores warning.
Mod bans.
As lag can delay the ban for as long as 10-20 seconds, the user may think they can get away with behaving like they have. Then they get shocked over the ban. I've seen this happen hundreds of times, and sometimes I get a forum PM because the user has even figured out who banned them. If that isn't proof they know why, I don't know what is.
However, a duration message would be nice.