Here is my single way of deciding what your favorite language is.
It is not "I like to write code in this language" but "If I am handed down a production ready system, I would prefer it to be written in this language".
A lot of people won't say the same answer to the first and the second question.
I think those are two separate concerns.
Writing code and running a tech business are two different things. I personally love Ocaml and think it's an excellent language and very underrated. However, I (probably) wouldn't want a production-ready system written in it, because it has a weaker ecosystem of libraries and frameworks, and it's harder to hire experienced people who already know or are willing to learn the language.
Indeed.
And the latter, that is, taking over and maintaining code written by someone else, is the more common concern in day-to-day jobs. More likely that you will get to build and improve an existing system than create one from scratch.
This heavily depends on the particular era of the language and the particular coding practices of the team though.
For example, I'm happy to maintain Python codebases with type annotations and type checking enabled. Those without better have a pretty solid docstring culture and be willing to add progressive type checking. It doesn't so much matter what version of Python it is.
They're becoming the norm for newer systems written in Python though. So I don't think the language is enough information to go on. This heuristic simply biases against languages that have been around a long time because more of their code was written before practices evolved.
Yes, but ... this depends strongly on whether your task is to maintain that production system in its current state indefinitely, or to keep developing it and continuously integrate with new technologies under time constraints. If the former, the right answer would probably be COBOL. If the latter, this is where things get interesting.
COBOL is used for the longest continuously running systems, particularly in the financial industry, many of which have been in production since the 1960s - mainly on mainframes, but noawadays also increasingly in cloud environments. There's nothing that comes close to the level of reliability that these offer, with the next closest probably being Fortran, Ada and Erlang.
I found this article with some numbers [0], with the top one being that "95% of ATM swipes rely on COBOL code". If you just need to maintain something in production, and only occasionally update the business logic, without having to upgrade the architecture, COBOL is the way to go.
My old boss wrote COBOL code for a core finance process… in 1975, well before I was born. He retired in 2019, and that code is still there with a few mods and probably will remain for another decade.
In fairness, it’s pretty fundamental stuff. But… the company has been working on moving to some Oracle bs for 5-6 years.
It is not "I like to write code in this language" but "If I am handed down a production ready system, I would prefer it to be written in this language".
A lot of people won't say the same answer to the first and the second question.