In what sense?
From this perspective everything is worthwhile.
If "worthwhile" is relative to learning other skills then Classical Latin and Ancient Greek is near the bottom of that pile, and you probably know what which is why you cited them.
So then the question is where coding sits on that hierarchy, and if someone should learn to code vs acquiring other skills.
Personally I'd not advise anyone to learn to code today. It's not just that I'm not convinced of the utility of the skill going forward, but I also think it's very hard to actually learn to code competently for someone starting out today. I had the luxury of spending decades coding without LLMs professionally. No one learning today is realistically going to have the opportunity to compete with old school coders with decades of experience writing code by hand, even if we assume the skill will be worth anything.