views:

876

answers:

12

Hi All,

Can anyone tell the reasons for choosing a particular programming language over others for a project. I mean does this thought cross the minds at the design phases of a project, or all this stuff is just theoretical, and in reality people use whatever languages they are conversant with?

Thanks

Aman Jain

+10  A: 

Some issues to note:

  • Productivity of the language (including tools - IDE, debugger, etc)
  • Employable set of people who have that particular language skills
  • "popularity" of the language
  • People in your organization who have the language skills
  • difficulty in learning the language
  • portability of the language/platform support
  • applicability to the problem domain (I.E. device driver and python most likely is not a good idea)

There are others.

In some places I have seen horrible mandates on language choice by managers who did not understand new-fangled languages like C++ so they would only allow C. Or there are managers who believe all the hype and press and choose, for example, Ruby where it has no business being.

Most often it comes down to one that your organiation has competency with and is mostly suitable for the doamin.

If you want to incorporate a new language for your organization roll it out with test/small/trial projects.

Tim
+2  A: 

I don't know anyone who picks a technology in a vacuum based just on the project. Typically, your choices are limited by the technologies that you know and you need to ask yourself with the project is achievable given those technologies. If you have the ability to choose from more than one, you'll choose the one that best fits the project. For example, a project may be more amenable to a scripting solution so you would choose Perl or PowerShell.

If you the project isn't achievable with your current technology set, you either need to abandon it or learn one that will work. Say you absolutely need the highest performance so you may choose to pick up C or C++. Or, you may have existing solutions that it needs to integrate with or be using an external component that is easier to use from language/framework that you don't know. In both of those cases it may drive you away from the language you are most comfortable with.

The hard case is when you can do the project with the tools you know, but it would be much easier to do it with another technology set. Then you need to decide whether the pain of learning and maintaining another technology is worth the difference in development ease with the new technology.

tvanfosson
+1  A: 
  • Does your project require speed? If so, use a lower-level language
  • Do you want ease of use, a language with an incorporated library full of everything you need?
  • Do you want a low-budget project? If so, use something everyone is more familiar with
  • Are you working platform-independant? Again, if so, use a platform-free language perhaps Java?

There's a large array of factors which make the decision of language use.

Kezzer
I disagree about speed. While low level languages give you the power to write very fast code, they also deprive you of fast ready-made features. For example if you need big maps, a Perl implementation using hashes will be much faster than a naive implementation in C.
slim
@slim: that means a choice between libraries, not between languages. they're related, but not determinant. there are lots of good hashtables for C. most are faster than perl's
Javier
I wouldn't know personally, I haven't much experience with them. It depends what you define by "speed" though. Java, C# etc. are really quite fast for a lot of things. Unless you're rendering real-time stuff it doesn't have a major impact.
Kezzer
+3  A: 

It depends on a number of a factors.

If you're on a team, and coding a project in-house, you'll probably pick the language that the team is most conversant in.

If you're developing a project for a client, and the client has specified the language because you'll be handing the source code over to them, you'll use that language.

If you're trying to learn a new language, you'll use that language.

If you're a hobbyist with a favorite language, you'll use that.

Or any number of other reasons.

Mike Hofer
+1  A: 

I'd suggest a list of programming languages that roughly fit the bill and start writing down their pros and cons.

But usually its the language people are most comfortable with that does the trick.

Ólafur Waage
+1  A: 

Depending on your environment, there are several factors:

  • Does the organization have a mandate for what language(s) must be used?

  • What languages does the team know?

  • what are the goals of the project? Technology exploration? Proof of concept? Broadening technical skills? Rapid development of a production system?

  • Can the project schedule absorb the coming-up-to-speed overhead if the chosen language isn't well-known to all team members?

  • What are the available resources for learning the language?

  • What are the requirements and options for long-term maintenance of the project? Is it a throw-away? Will it need to have production support for ten years? Who in the organization has the skills to support it in the long term?

  • what is the payoff for choosing a candidate language? Does it offer some particular advantage that compensates for any learning curve? Is it "the best fit" for the deployment environment? Does it have a set of available libraries well-suited for the task?

As you can imagine, this list can be extended; the key IMHO is to look at the organization and the long-term vision for the project, not just the tastes of the current development team.

joel.neely
A: 
  • The language one is familiar with

  • The language that has all (or most of) necessary libraries freely available

  • If the project is to be something new, not known yet, consider some language that allows fast prototyping (like Python). So you can do some quick draft and see what's going on there.
  • The language with nice and friendly IDE (possibly also cheap one :-) ).
Abgan
+1  A: 

In most cases, the language is fixed not only because developer experience, but also application context - most applications need to interface with other applications, which is usually easier to do within the same language. These two points often merge and become entrenched, so that companies end up as a "Microsoft shop", or a "Java shop".

In the relatively rare case that you start a new project with no dependencies and have yet to hire developers, the main factors would be:

  • How difficult/expensive is it to get enough programmers that are competent in a language, and/or how long does it take to become competent in it?
  • What libraries or frameworks are there that could save you time?
  • How "powerful" is the language?

Probably in that order.

Michael Borgwardt
A: 

If you don't know which language to choose, find someone with experience. It is meaningless for me (or anyone) to describe some algorithm for choosing a language. It's more a combination of gut feeling and experience than some flowchart-like decision.

Dmitri Nesteruk
A: 

Also, it's important the platform you're developing on and the platform you're developing for. If it's an open source, personal project, then use the latest technology you can find so you can have some fun with it while learning something new that you know you ain't gonna use in your workplace on a short term. I for instance, made the same client app for KDE and GNOME,for the first I used Python, and for the second C# even when my day job is at a Java shop.

Ubersoldat
But, careful! If you choose something too cutting edge, it may become a barrier to your program's adoption. I've discounted open source applications because the prerequisites were not mature enough to install. I have tried apps that don't work because of changes to the underlying platform.
slim
A: 

As if the answers already provided don't already demonstrate what a complicated problem it is - bear in mind that a project need not be restricted to one language alone.

  • You might choose to implement the project in a scripting language, then profile and create fast implementations of the performance-critical parts in a lower level compiled language
  • You might write a high performance core engine in a low level language, embed a script engine and write the rest in the embedded script language (many video games do this)
  • You might go SOA, in which case you can pick a different language for each service if you so choose
  • You might be client-server, in which case the client and server can be written in different languages. Common case: web applications with Javascript.

Choosing languages for this kind of scenario, you have to think about the 'glue' that allows these languages to interact.

  • Python and certain Scheme implementations are strong on embedability
  • Perl has tools for writing modules in C
  • Java has JNI for invoking compiled native code
  • JRuby lets you use Ruby syntax to drive Java programs
  • ... and much more
slim
A: 

First of all, the components of code quality are familiarity with the task, with the language, and with the toolset available apart from the language. Once there is passable knowledge of a sane programming language, that is the least important element for productivity (if you need to be a wizard to get anything done, then that suggests that libraries or the language are not sane).

So, next of all, one would choose based on what support there is for the kinds of tasks one needs to do: in general, any environment that requires less boilerplate is going to be more productive.

Finally, one needs to consider the tradeoffs between using a new, more desirable element (language, tool, or library) as against the costs of doing that. If the team does that task all the time, then upgrading is likely to be valuable; by contrast if the team is in a state of chaos, the costs may be particularly high.

Marcin