Do you want to make more money, get more connections, have everyone like you more and treat you better? It's as simple as buying some nicer shirts, getting regular haircuts, and eating better (which has its own host of plusses).
Some programmers are 55 and really good. They also have stains on their t-shirts, are overweight, and act morose all the time. In a perfect world this wouldn't matter for a job interview, but you are not interviewing or operating for a job in a perfect world.
I'm not saying that one shouldn't adapt a bit, but dyed hair and "How do you do, fellow kids" clothes overshoot the goal by a good bit.
Describes more than one 20-something developer I know. Being a sloven does not correlate with age.
This seems like a minor thing, but assuming you're not incompetent, someone who knows how to dress themselves will be perceived better by those whose opinions matter.
The key is to match the general attire of the people around you, but do it a bit nicer. If everyone is wearing shorts and jeans, don't wear a suit to work.
Edit: This advice isn't limited to young people, there are plenty of older people that need to learn how to dress themselves. As a general rule, though, the younger generation dresses a lot more casually than I did at their age, and many don't seem to have been taught when an occasion calls for dressing a little nicer.
Embrace the gray beard, find one of those companies that welcomes us geezers, and clearly articulate how our decades of experience translates to business value.
Clearly there are some companies more open to more senior people in various roles. At some level, the path of least resistance at least is to accept that.
I'm 49 and have gray hair, and have since I was in my mid 30's, but I've not had any trouble getting work when I had to (or wanted to) change jobs. That said, I dress fairly youthfully (in typical Silicon Valley jeans/untucked shirt) and am told I don't look my age.
Forget about you 50 year olds out there, I was the stupid 22 year old wearing a suit out of university.. didn’t get any offers till I put on a scandinavian accent and dressed like a hipster.