Short version: the person who does not have their hands full, no matter what sex they happen to be. The younger of the two people, no matter what sex they happen to be. After that it gets messy.
I suppose it is a sign of just how prosperous the western world is, and how few real problems we have, that “Who should open the door to the building” generates so much fuss on the internet. The most simple answer is to look at who has their arms full of packages or is trying to wrangle multiple small children, and open the door for them. Can the other individual physically open the door without help? No? Then you open it for them (provided you won’t drop what you are holding.)
The younger, more able individual opens it for the older or less able person. This is just good manners and being polite, as is the above. Do unto others, et cetera.
But what generates so much furor is “should a man open a door for a woman?” Not if his arms are full or he has a toddler under one arm and groceries or parcels in the other (see Rule #1). And if he is 90 and needs a cane while she’s 30, well, see Rule #2, unless he insists. Then the lady is gracious, accepts the gesture and thanks him profusely, and gets the inner door (if there is one).
I was raised that gentlemen opened doors and ladies said “Thank you, sir,” smiled, and went into the building. Especially if the lady had her arms full. A younger lady got the door for an elder lady if no gentlemen were around. If a man opens the door for me, I smile, thank him, and go through. The only exception is if I’m loitering for a reason. Then I smile, say, “Thank you but I’m waiting for someone,” or “Thank you, but I need to fasten this/get these things arranged,” and then go from there. It has nothing to do with him being superior or inferior to me, or me submitting to some patriarchy or something. In fact, in true patriarchal societies, women often go behind men, open doors for men, and are restricted from going places where men are permitted free access.
Note that we are talking about doors to buildings. Doors to cars are another matter, and that is so regional and variable that it’s probably safer for the gent to offer to get the door and see how the lady feels. I don’t really appreciate well-meaning gentlemen closing the car door when it is 100F outdoors and the car has been closed for a few hours in the sun. I also don’t whine if an older gentleman does just that, because I know that some training is firmly ingrained in people.
But what about the argument that since feminists have declared all women to be just as good as or better than men, and make such a stink about doors being opened, a man ought to let any female-type person deal with her own d-mn door? Are her arms full of stuff to the point she can’t get the door? Open it, please, if only so other people don’t trip over the stuff that she’s going to drop.
One hallmark of a lady or gentleman was the ability to make things easier for everyone else, by opening doors, giving seats to those who truly needed them, making small talk that sets people at ease no matter who they are, and treating people with respect. “Do unto others…”
I appreciate an opened door. I also open doors for others. It’s just basic manners no matter which chromosome set a person has.
NOTE: I have lost my patience for arguments about Men’s Rights and Feminism destroying all need to be polite to members of the other sex, and so on. Don’t beat that dead horse in the comments, please.