Programmers.SE has plenty of questions of beginner programmers asking if they must use a specific language or another one in their daily work, or if they must learn a language or another. Those questions are quickly closed, and when they receive answers, those answers are of type:
Use what is best for a specific project.
There are languages that cannot be reasonably used for some sorts of projects. For example, it would be strange to use Assembly to create a dynamic website, or to use PHP to create a rich desktop Windows application or to use Ruby to create a video game with hardware acceleration.
But in general, does the "Use what is best for a specific project" rule work?
- If I create a simple business desktop application, how can I say that for this business app, C# is not appropriate at all, while Java is the best choice?
- If I create an ordinary small or medium-scale website, how can I say that I must use C#/ASP.NET MVC over Ruby on Rails?
Comparing mainstream languages, they are all pretty similar. I choose C# over Java because I don't know Java very well; I choose ASP.NET MVC over PHP because in my opinion, PHP sucks; I choose PHP over ASP.NET MVC when my customers have a web server running Linux. In all cases, every time I have to to a choice, I consider:
- my skills in the languages to choose from,
- languages I personally want and enjoy to use,
- software and hardware requirements (i.e. difficulty to deploy Java or Ruby on Rails website on a server which has already a support for PHP),
- legacy and interoperability concerns.
Does it mean that I lack broad knowledge in several languages? What happens in other companies? Is there a real choice, for every project, of the language which is the best one in a precise case? How could such choice be made in a situation where the mainstream languages are so similar?