Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Today I asked myself a quite fundamental question, well .. I guess it is one. But google- and SEing couldn't give me the answer I was looking for. I'm writing programs for quite a few years now, but the languages in which they were written, was always given by higher seniors, customers or by myself for learning purpose.

Let's say for instance that I want to write a application with basic functions, like database access, calling webservices and so on.
Which language should be used, and why? Ignoring factors like cross-platforming, UI, which DB system or webservices are used ... imagine something like a black body in physics.

As example, why should I use Java over C++ or Python over Ruby? Not saying that this question is limited to these languages.

Are there good reasons for choosing an specific language, like performance or memory usage, or is it, in case of a "black-body-situation", just the personal preference which determines the actual used language?

Thanks in advance.

... and sorry if this question is to general.

share|improve this question

closed as too broad by Corbin March, user16764, GlenH7, MichaelT, Bart van Ingen Schenau Aug 17 '13 at 11:23

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

5  
Choose language that deliver required functionality and you feel comfortable with. –  Yusubov Aug 16 '13 at 21:14
1  
I'm confused here. You want us to choose a language for writing an application with database access and web services... and you want us to make that decision without taking the database and web services into account? –  user16764 Aug 16 '13 at 23:07
    
Choose a language that your team is already comfortable with. No pointing in using C++ if you a group of python developers. This is usually the main limiting factor. You don't want to start a new project where everybody is learning the language at the same time. –  Loki Astari Aug 17 '13 at 16:19

2 Answers 2

up vote 6 down vote accepted

I'm a hater of the sentence "use the right tool for the job". Nowadays, any language can do pretty much anything you want to do with it (except if the language has recently been created and is still in the early stages, i.e.: Rust).

So then IMO these days what you have to do to choose your programming language is not ask what you're going to do, but know what you want to avoid.

So I use this rule of thumb:

  • Do I want to avoid paying licenses (or resorting to piracy if I'm in the early days of a startup and I don't want to spend money), then I choose a language and a set of tools which have open source implementations (compiler and class libraries) (i.e.: C++11 vs MS Managed C++)
  • Do I want to avoid chasing memory leaks for the rest of my life? Yes, therefore I use a language which has garbage collection (i.e. Java vs C).
  • Do I want to avoid painful evolution of my project, especially when it's getting larger (wrt easy refactoring and maintainability)? Then I use a statically typed language instead of a dynamically typed one (i.e. TypeScript vs JavaScript).
  • Do I want to avoid recent headaches I've had with other software projects in which concurrency was very hard (read: race conditions), then I choose a functional language (to achieve immutability, avoid side-effects, etc.) (i.e: F# vs C#).

And it's not that I ran out of questions, there are many more...

But, did you guess it? The questions above are the most important ones you should ask yourself when choosing the next language to use/learn, in my opinion. And, did you guess it? This is why my current favorite programming language is F#: because you can avoid most of the pitfalls that you find in other programming languages in the industry, and you still can do pretty much anything with it.

UPDATE: There are other new languages out there that are gaining traction (or old ones that still kick in like Haskell), but I still don't consider them stronger than F#. If you're interested in knowing why, I have more details in this link.

share|improve this answer
    
Though I'm not a fan of F#, your answer got close to what I was looking for. –  Pr0gr4mm3r Aug 16 '13 at 22:04
    
Agree it is a bit of a cop out. Obviously if you got it to work you at least picked one of the right tools. –  JeffO Aug 17 '13 at 2:35
1  
+1 I would add that if you are in a team situation and/or are delivering something for which a client's team will take over maintaince, then you need to consider the experience and skill of your/the client's team members as well. It c/would be very detrimental to use language X when no other team member that will be responsible for future developement has the required experience and skill level with X. –  Marjan Venema Aug 17 '13 at 9:26

Programming languages are all about productivity. Otherwise we'd all be flipping bits in a hex editor. If you take away all the other motivations for using a particular language the only thing left is how productive are you in a particular language.

Productivity has a lot of baggage that comes along with it though. The availability of existing libraries and frameworks are just as important as how easily you can read and write in a language. Additionally, if a project is too big for you to tackle on your own then the availability of other developers experienced in the language is also important.

share|improve this answer
1  
Exactly. Let's face it, a tool in the hands of someone who doesn't know how to use it, is a huge liability. –  JeffO Aug 17 '13 at 2:38

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