By that logic, you shouldnt hire women, since they may get pregnant and take extensive leave on your company’s dime. Or men, whose partner could get pregnant (or adopt).
> have/spend time with their families
Applies to anyone over the age of 18. Probably under 18 too.
> theyve already been trained in some other work method
Which is why once you learn one programming language, you are immediately banned for working with any other language.
Although you're presenting this as obviously absurd, taking that risk into account was long practice wasn't it? Forcing companies to pretend women are as likely to suddenly disappear for long periods as men is ultimately an economic choice and debatable as such in economic terms. It's essentially a kind of welfare that companies are made to pay, except instead of being an insurance scheme with actuarial rigor and smooth risk sharing over the entire population, it's a form of regressive taxation that disproportionately impacts smaller firms.
It can therefore be argued that it'd be better for society to take a different approach here, maybe more similar to (non-US) healthcare, e.g. mandatory maternity leave insurance, and then allow companies to simply price in the higher risk of extended absences. If they're no longer on the hook for paying wages this difference would be basically disruption risk and shouldn't be a particularly large difference for any but the tiniest firms, especially as motherhood comes with a much longer notice period than the typical resignation.
When someone is too young, however, there can be some guaranteed deficiencies that don't require any assumptions in order to know the requirements can't be met; for example, if you are looking to hire someone to create and execute a 10-year plan with prior experience doing so, it's impossible for a very young person to be qualified.
We hired them for prior experience on purpose, yes.
> have/spend time with their families,
If that stands out, your company has a serious culture problem.
> have retirement sooner,
Isn't the average time at a job like 3 years in tech? Who cares if they leave for another company or retire at the end? Outside of tech I'm still skeptical that the odds of jumping for another job vs retiring is that different, actually.