Sadly this is too common. But what about proper changes of job? Going from embedded to game dev to web to HFT to Ai? Do people not do this kind of switch at all when they say “I just work 1-2 year stints”? That sounds like a pretty dreadful career to swap one crud gig for another, never really knowing a domain deeply.
while I did switch like the ones you mentioned
then I don't agree with you calling it "proper"
I'd call it: making yours life harder due to curiosity.
To some that’s probably also something that’s intellectually satisfying.
Is rational the same as “maximizing career income”?
I just feel it’s hard to give up domain knowledge in one thing (say insurance or flight scheduling or whatever) that you aggregate, to be a complete rookie in some other business.
Software skills are the easy bit. It’s the domain knowledge that takes time.
Rational employees want to feel good at their job, intellectually challenged, and appreciated for what they do. That involves financial compensation but I think it’s far from the major driver.
Perhaps there are two major categories of devs: those that have broadly applicable skills (say web development) but no really deep domain knowledge or interest. They can write crud for insurance year 1 and crud for food delivery year 2 and continue that way forever while making good salary jumps each year. To those it seems almost like a bad idea to grow too fond of the details of insurance, as it would hinder their careers.
On the other end of the spectrum you have devs that aggregate lots of domain knowledge in some narrower field. They might switch jobs every 10 years but when they do they almost have to go to a competitor in the same industry because otherwise they throw away too much domain knowledge. The only way they can capitalize is by selling that knowledge.
I'd care a lot more about the long-term effects of the code that I write and the systems that I build if I was given ample opportunity to actually engage with long-term planning. But I'm not, so I care less about what impact I have a year or two from now with each passing day.
In my career so far, it is not uncommon to see low hanging fruits like that, but then I mostly worked in banking ( which is its own little world ).
My point is, you can do a lot in 2 years depending on what you are looking for.
Two years is plenty of time to make an impact at a startup.
Companies don't hire employees to be a preschool playpen for adults. They hire them to do work.
Similarly, management that only looks for this is offering no reward for better, and deserves the attrition they'll see.
There are roles and companies where growth is both valuable and rewarded. I think it has to be an org where the technology is the product, and not a cost center (necessary, but not sufficient). I think you really have to be paying attention to know what type of org you are in. Taking this attitude up-front at any new job, you may not even see the opportunity.