10

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?

  • 1
    Note that for any non-trivial project you will need to be several people working on it and you most likely will have different skill sets. – user1249 Aug 6 '11 at 18:46
  • If you don't have at least some freedom to choose the language, you're probably not going to post a "what language should I use?" question. That leaves "what should I learn because its popular?" and "what horse should I choose for a particular course and why?". The first is answered by a few popularity contest sites. The second is hard to answer if no-one tells you which course, so you tend to get the generic "whatever works for the project". – Steve314 Aug 7 '11 at 1:08
  • "comparing mainstream languages, they are all pretty similar" -- since you know this ... your question now becomes... "why are there so many similar languages" .. and the answer to that is your answer too. – treecoder Aug 7 '11 at 5:04
  • "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?" You can't. If it needn't be cross-platform then your UI will be done far better and in less time by favoring C# (with WPF or Winforms) over Java and Swing. Just because the UI-Framworks are far better in .NET. I know both worlds equally well. – Falcon Aug 7 '11 at 8:16
13

As we engineers all know, there is no such thing as the best, best can only be defined if you have some kind of metric to compare alternatives.

  • Do you feel comfortable in working in that language? If not, you'll probably pick bad design choices on the language level.
  • How fast can you develop features for your app in that language? Is it easy to extend functionality for an existing code or it is going to be a PITA because the language creates too much constraints?
  • Is the language fast enough? For some tasks this is mandatory, for others, where you can easily scale with multiple machines it hardly matters.
  • Does it compile to native code? For some software this is mandatory, people won't install your small up if it comes with a 50-500M runtime environment.
  • Does it provide the necessary libraries and tools (reading XML, working with all kind of databases, etc..) You don't want to reinvent the wheel. Ok, this is probably not the best point on the list, most languages are mature enough for this, but if you pick a relatively new language/framework this can be a problem.
  • If you need external hosting, is it well supported?
  • (if the project is large enough) Is it easy to find developers? Are they cheap? This is an economic factor. I agree that PHP sucks, but there is an abundance of PHP developers and they are cheep (at least compared to a Java or C# developer). Let's be honest, making an average website is not rocket science, doesn't require much skill (at least until you have a lot of visitors or a really complex system).

So, a metric is a mixture of all these factors with different weights. Now choose your weights and pick the best ;)

Because the weights are judged subjectivily I would say that theoretically YES, there is an ideal language (or a handful of languages) for a specific project, but practically NO, you have to choose a language you are already familiar with and think that is the best for the job.

| improve this answer | |
5

A trademan always uses the right tool for the job. As a rule a programmer will usually turn every problem into a nail so he can use his hammer.

The reason for this is unlike an average tradesman, who has a hope of becoming proficent using all the commonly available tools, even an expert programmer has no hope for that, and therefore must become proficent in one or two "tools" of many, or pretty average in many and proficent in none.

Therefore the "best choice", unlike a trademan's, is more about the environment rather than the technical "best". For instance, I am aware of a large ADA project recently re-written in Java, largely because you cannot recruit ADA developers anymore, and Java programmers are a dime a dozen. Java is probably a long way from the ideal technical solution, but Erlang (likely a far better language for their problem domain) isn't even a contender in 2011 due to lack of potential recruits.

| improve this answer | |
1

Something nobody has mentioned yet, but it's a deal breaker for us is community, both for Q&A & packages. Now, this kind of applies to frameworks (that, honestly, often times are the only way to work with that language, take Laravel / Symfony for PHP).

If you recognized this problem, congratulations. You're intelligent and you also have the practical humbleness element, you understand that no matter how good you are, problems always arise and boy does it feel good to have a network of people to chat with about it and them helping you.

The issue still applies to the language itself, if you plan on using it for something else other than it is popular for. Take django of Python (assuming your intent is to create webapps with Python). I can tell you from my own experience that although Django on SO seems rather active and most questions are answered, you'll never get help with anything above "easy-medium" level, so if you met any complex related to something like Q objects, you're all alone.

For me, personally, the fact that anime.js doesn't have an active community is completely disheartening and it's slowed down development by quite a lot having to figure out a lot of simple, yet not obvious quirks that I'm pretty sure if there was a community, someone would've asked before.

The last layer is the profficiency of the community. If you go through my questions, you can see they're related to PHP, but in a way that almost no one's doing: SOLID-pretend / OOP. Out of all the "senior" developers I've met and read, a lot of them don't understand issues like the lack of complex return types, no good / clean way to handle an object with multiple interfaces, etc. that show me they've never attempted to work on something complex and do it right. PHP's lack of tools & better alternatives has left the community with people who aren't exactly programmers, they're people who know how to code and they might be very good at that, but it's increasingly hard to do something the right way.

A direct, concise example:

Going back on my codebase, I keep testing and discovering new things on code that I wrote / others wrote that I wonder how in the hell we missed not-so-subtle bugs & oversights. Especially if you're dealing with weak-typed languages that don't necessarily have a lot of useful constructs for you, it's very easy to fall prey to the idea that your code is good and won't break and as such, you become complacent. If you ask me and this is not an attack on the individuals, but rather the lack of vision on the end of the creators & maintainers of PHP is that, by allowing it to be an easy language to learn, they chose not to implement a lot of features on the architecture side of things (as said above) and as such, the community is mostly made out of people who only write code but aren't programmers & architects, so, you end up with a community of people that can't help you if you have a complex issue that is, you'd think pretty common when developing in a certain way.

| improve this answer | |
0

Often enough you have a choice of several equally adequate languages and you can simply choose the one you like best.

In many other cases there are clear restrictions that sort out at least a large part of possible choices. If you application needs to run on different operating systems, then Windows only languages like C# are not on the list anymore.

| improve this answer | |
  • Company culture or politics might also rule out otherwise reasonable choices – Kevin Aug 6 '11 at 18:53
  • @Kevin, that somehow goes under the "what you like best" clause. "Company Culture" is just what our company likes best and for what it has the most resources. – thorsten müller Aug 6 '11 at 18:57
  • Yes but there is a difference between what the company likes and what an implementing developer likes. Typically the same but not always – Kevin Aug 6 '11 at 19:00
0

programming languages are more about social and personal expression than about features. In fact, most modern programming languages have the same features.

Because they're mostly social, the most important things about programming languages are: the ecosystem, the community and the availability of programmers.

The ecosystem is the mix of libraries, tools, and frameworks that support the language. Their quality and the work out into them matters the most. Therefore, I look for things like: how many are they, how often are they updated and how many open bugs do they have.

The community is typically the one that maintains the ecosystem. Even when backed by a company, the community is the main drive for improvements, often implementing them. Therefore I look for things like: message boards, how many people contribute and how much chatter about the technology (blogs, social media, conferences, screencasts etc).

The availability of programmers is self-explanatory. Some technologies, like Haskell, are appreciated in theory but less programmers are available than for Java. It depends of course how many developers you need; if only 3 it doesn't matter that much, if 300 then it might be an important factor.

So here they are: three factors that apply to all technological choices. The list is not exhaustive because the type of application (web, embedded, mobile, etc.) might limit the choices.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.