I agree with Fomenter that being an asshole right off the bat rarely helps. Now, if you tried polite and it didn't work, some righteous indignation can be good, especially if it overrides the "respect to authority" wiring we all have.
But if you start off by being a dick, you may be in the right, but it doesn't incline the officer in question to treat you fairly and, if it gets in the press, you end up looking like a petulant child. Maybe I just take it for granted that people in positions of authority will try and bend or break the rules, but it doesn't annoy me until the moment the act has actually happened, not beforehand. If I can talk them around it, all good. If not, and they do cross the line, then its a good time to start getting angry.
For instance, I was stopped by anti-terrorism police in London. People like me (ie; those who have studied terrorism) are often a favourite target of such police. If we kick up a fuss, its almost certain we will have "terrorist literature" on our computers and they can drop us into solitary confinement for a month if they want, without charge while they "investigate". For a foreigner, its even worse. Deportation rules are highly relaxed, and you don't have to deported to your country of origin.
So getting angry before any of those things was not an option. I quietly filled in the form with as many useless, within-the-norm stats as possible, handed it back and then told her I did not appreciate being stopped while going about my lawful business, nor having my details recorded, and that I would be informing my MP of such actions, as well as possible discussion with the IPCC about the practice. I then requested her badge number and went on my way. The IPCC are, of course, useless, but my MP is a Tory, and he is part of the (current) fake libertarian bandwagon that is going on in Westminster. Plus he generally loves pissing off Labour and, being the MP around here offers little in the way of things to hurt them with. And having her personal badge number, it was entirely possible a shitstorm would come back on her, personally. The Met love hanging out scapegoats when opinion go against them.
Anger at the wrong time is just an excuse for people to dismiss you as irrational and help justify (in a perverted way) what happens to you. Keeping cool, assessing the situation logically then striking back in unexpected ways is much better.