2) Many people voted for Obama at least in part because he was black, including myself, because they felt it was time to demonstrate we could and should elect a non-white-male president.
3) The president is a very special singular office, whereas there can be an almost unlimited number of coders. Affirmative action for the role of president or elected political office doesn't make a lot of sense (unless it's done by choice of the electorate.)
4) Indeed Barack Obama is a role model for black men. He showed that a black man (and a non-white-man) CAN be president, something hardly anyone thought was possible in our lifetime prior to his rise to prominence.
5) While a white man could be a role model for a black girl in some sense, people identify with those who share a cultural and racial heritage.
While on a certain theoretical level, what you say makes sense, it is not true in the actual world in which we exist.