I don't worry about ageism. What counts in tech is your ability to code. As long as you keep your skill set up, you'll be fine.

Now, it is true that there are some companies where they will discriminate because of gray hair. First of all, that's totally illegal. Second, I don't want to work for them anyway. Because there is more demand for devs than there are devs, we have a lot of mobility, which means in general we'll be treated very well, as long as we are willing to change jobs when warranted. Now, that hasn't always been the case, and it's entirely possible that a downturn in the economy will change that. But frankly I can't see that far ahead, so I don't worry about it. If you are getting crapped on because you're 30, that's absurd. So leave, or consider documenting it and sue the heck out of them (same if you're being harassed, discriminated because you're different in any way, etc).

I have held management positions. I chose to stay technical track because I love doing what I do and personally I think management is unnecessary overhead that contributes very little. I can build an entire app without someone telling me what to do. Now this isn't the common view and corporations like having managers, probably so they can hold someone responsible in case of problems, but shrug.

This should not dissuade you from management, if that is what you want. There are managers out there that I like. The best managers IMO are enthusiastic, charismatic, supportive, and trustworthy. I'm a bit surprised that you work for a large company and you don't see much opportunity for management. I am currently at a large company where people are encouraged to try management track. Well, that suggests that you might want to look for a company that can support your career growth aspirations better. Aside: how to get into management? Act like a leader. Speak up, make recommendations... if you act presidential, you stand a better chance of getting elected.

The way to earn respect? Treat others the way you want to be treated. There is a fine line between self confidence and hubris, and the best way to not cross it is to never get close to the line. In my case I know I am good at my job, but I am nice to everyone else regardless of skill level, I go out of my way to help people if they are asking questions, and if someone does something cool, I compliment them.

The fact that you ask suggests that you're currently experiencing some problems. If you work in an environment where people snipe or try to undercut each other... leave. It doesn't have to be that way, and life is too short to put up with BS. Now it occurs to me to say that it could be your opportunity to rise to the challenge and change that culture; get promoted to management and be the change you want to see. That is up to you of course.

I feel we devs are very well paid, compared to teachers, scientists, and basically anyone else out there, so sometimes I feel guilty about pulling a high salary. On the other hand, I'm not hurting anyone, there's plenty of money in the industry, and I'm really glad to be able to provide for my family. So about people making more than me? This industry is really weird. I know people who have made millions in stock. If things had gone slightly different for me, I'd own an island somewhere sunny. That's the luck of the draw. But I've done fine, and I have no regrets.... except I should have bought AAPL when it was $6/share lol.