I think the reason is simple: once the junior dev is trained, they will leave. To be clear, I am not saying that they are obliged to stay in the company that trained them or being ungrateful in any sense, I am simply implying this is a common outcome from such training. In software industry, the first job switch in 2 years seems pretty common and reasonable, and the dev by that time would be able to strike a better j…
Kind of curious about what you're saying. Essentially that when the dev is getting up to speed with that training they quickly become more valuable to the company but the company isn't willing to acknowledge it?
Another part is that if you hire an inexperienced programmer, not only do they have lower productivity than an engineer with 2+ years experience, but they lower the productivity of at least one other senior engineer that needs to mentor them and bring them up to speed. I'd estimate that mentoring a new inexperienced hire would at least half the mentor's productivity for a couple months at least. If you hire someone that's already worked a couple years, that lost productivity was paid for by a different company.