I strongly believe that the best and smoothest form of discipline is a combination of proactive and reactive measures. For me, proactive measures entail spending some time throughout the first weeks of teaching to establish clear classroom expectations and rules. I make a point of going beyond a list of rules by defining the words I use. So I don't just say that I expect punctuality, respect, politeness, curiosity and engagement, I explain what these words mean in practice. Also, because I believe that in middle and high school students already have an idea of what they can and cannot do, I typically let students tell me what they think the rules and expectations should be, and I only add on to what they say with rules and expectations they have omitted. Because I like when in my classroom we are all at the same level, I usually do so while we all sit in a circle on the floor.
Reactive measures are dependent on the problem. Whatever they are, the class must go on. Unless the problem is so important that it requires stopping everything else, I react in a way that disturbs the lesson and the rest of the students the least. I value the involvement of the student at fault in the problem solving process, and for bigger problems I make sure to have a talk with the student in question. In my opinion, the best way to solve an issue is to guide the student to solving it him/herself.
It is my belief that a teacher must be strict and consistent, but flexible and keeping in mind that mistakes happen and that the point of discipline is to improve student's future behavior, not to punish. Kindness is often an essential part of discipline.
I have high hopes in all students and I have found it very effective to expect maturity of my students right away. Showing such expectations make them more mature and self-check their behaviors.
Finally, it is important for educators to remember that misbehaviors sometimes or often reflect a flaw in the educator's behaviors. When or after a student "mis"behaves, it is a good time to reflect: are expectations clear? Did the teacher do something that devalued the student or invited conflict? Is the atmosphere of the classroom not positive? Does the student's attitude actually show a valuable skill, and if so, how can the misbehavior be turned into a constructive behavior?