Interestingly, I find it far easier to be polite online than in person, because I don't have people right in my face, and I can just ignore them I feel like they're wasting my time. I can be myself online, in ways that are sometimes feasible in person and sometimes not.
As for being rude -- well, sometimes the most honorable thing to do is call a man a coward to his face when that's how he's acting. Be polite, but don't impersonate a doormat. If your honest opinion is rude, lying about it is hardly any nicer than voicing it.
Because there are a great many things that need to be said and done, that could get someone fired for saying even outside their job, which is legal but not acceptable. Online anonymity is a necessary precaution for many people and topics, so ignore this rule. Just don't use anonymity as an excuse for acting like a jerk. You are still responsible to yourself even if nobody else knows who you are.
The thing about being a gentleman is this: It doesn't matter what other people think of you. It matters whether you live up to your own expectations of being a decent, responsible human being.