I’m also a programmer and I’ve had extremely similar experiences. Companies can get away with this sort of abuse because we need them while they don’t need us (they only sort of would like more of us). If the tech industry is ancient China, then companies are the emperors and programmers are the concubines— never enough, but utterly unimportant (recruiters also fit into this scheme, but their role is too impolite to mention here). And like you said at the end, the only long-term way out is to build your own company. Best of luck to you.