How to avoid student favoritism in the classroom? FYI: I am teaching undergraduates, and am fairly recently out of grad school myself.

I find myself unconsciously treating/regarding students differently based on their engagement with the class. I find that I tend to favor students who do their work, arrive on time, and participate in discussions over those who do not.

By "favoring" I don't necessarily mean that I give them special treatment or higher grades - but I find that I do treat them better, visibly. I am more patient with them and speak to them warmly. Enough that students have noticed.

I believe I am having trouble being professional, having been in their position so recently. I can see that certain students are really enjoying the material and find the work to be exciting, and I respond emotionally to that energy.

I realize that it is inappropriate to treat students differently based on the level of their engagement with your class, so how, if you teach, do you not take it so personally?
[Since there will be very different views on this matter, I've kept my answer in first-person to indicate that this is my viewpoint and not a guideline of a sort.]

Whilst I agree with the comments that to an extent, it is perfectly natural to respond differently to different levels of engagement, I think a good strategy is to consider the world outside of the classroom and remember that behaviour in the classroom is a product of many causes.

I do this when I teach and I notice that I start disliking students for not turning up, lack of engagement etc. I then recall my first year at Undergrad level. I was severely depressed, attended barely 20% of my classes, just about managed to pass the year. I am sure I must have appeared absent, disinterested, the sort of student that my lecturers would ask "why would they be here in the first place if they don't attend anything?" - but my classroom behaviour (or rather, the absence of it) had absolutely nothing to do with the classroom itself, nor the teaching, not even the material.

My personal background helps me to consider such a scenario- but I think there are plenty of other things, such as:


undisclosed/not-diagnosed disabilities and/or illnesses affecting students
international students having to find their way in a very foreign world
related to 2., oftentimes young students and their first experience abroad, on their own
family background: crises at home, responsibilities for parents/grandparents/siblings that would not normally be considered
Perhaps just the natural way of things: students realise that what they thought they would love to study turns out to have been an illusion. They are not at the stage of dropping out (possibly due to parental/financial pressures) but are clearly not willing to 


Whatever they do, I try to refrain from judgements on their character as much as I can. When a student is not responsive to my teaching, it does not necessarily imply a judgement on me, either.