When a welder helps to put together an oil rig that then either makes millions of dollars or explodes, sinks and causes billions in damage the fact that he did it as a salaried employee shields him from the damage just as much as it will insulate him from taking a share in the profits.
That's why it's work for hire. You get to decide up-front if that sort of thing is what you want.
So if someone offers you the opportunity to program a computer and make that company millions of dollars you are being compensated for your time, not for how much money your software will make.
The shareholders of the investment bank and the people that thought up the spec for the thing that you are building will have a much bigger claim to the profits than the guy that codes it up, and not surprising, they're the ones that will eventually make more money on it than you.
Why programmers should be different in this way from welders is not clear to me. Everybody that works for 'big-corp' makes the same kind of deal, and if you didn't make more money for the company than you cost you probably wouldn't have a job to begin with.