Eh... sure, if you're only paying federal taxes. But in on that $140k you're going to end up with about $92k. And everything is more expensive in cities. The idea you're going to live in SF and save more than about half that, even living like a monk, is kind of fanciful.
NYC is even worse - lop another thousand off and pay even more to live.
I've personally lived in both cities and you can live perfectly well on $4k a month with a couple of roommates. Better than the average American even.
Then, if you invest $46k a year for 15 years at a real return of 4% you end up with ~$943k in present day dollars which is right around what the parent was saying.
Not to mention $140k total compensation is relatively low for a senior dev in SF/NYC, you will likely be making a lot more 10 years in.
You will be making $200k+ in SF even in your early years, if you climb the corporate ladder you can get to $300k in 5 years.
You can definitely sock away enough even without a 4% rate of growth to put away $1MM of after-tax money in 10-15 years, if you're smart with your money.
NYC is even worse - lop another thousand off and pay even more to live.