The housing crisis and (to a much lesser extent) generally high wages amplify this imbalance.
Lots of people say that Silicon Valley pays particularly well, and I think this is true only statistically. Silicon Valley pays world-class engineers more than Chicago pays mediocre engineers. I believe a world-class engineer is likely to make more in Chicago than in Silicon Valley, provided that the engineer can find a suitable job at all in Chicago.
So if want to maximize expected income, I think you should live in NYC working in finance, or if you don't like that option, anywhere in the U.S. except the Bay Area. I don't know anything about the rest of the world so I wouldn't give any advice about that.
If you want to maximize the likelihood that you can find an interesting job in software, you should move to the Bay Area.
In NYC I lived in Brooklyn and took the subway to work and was pretty happy with that. In silicon valley this is usually not an option. There are company shuttles, but it is not the same as just jumping on the next city bound train.
You will need a car, and you will want to live in expensive areas to avoid horrible commutes. This is also true for SF, the transportation system even there is nothing like NYC, even including NJ.
On a personal level, I find SF/Bay area much more boring than NYC. The food options are nowhere near as good either. I'm happy with that as I'm getting older with a nice house and family. But if I was 25 I would stay in NYC, there are more than enough tech jobs there and you can live for cheaper if you want.
I really liked Brooklyn, there is a lot going on there.