views:

295

answers:

10

Possible Duplicate:
How to select a programming language for a project?

I'm in the process of starting a new programming project. It is not a large project, it's a rather an academic one. However, all my life, I've suffered from programming-language indecision. And I truly believe this is a pathological condition. I know two things: 1) I usually hack in C# (and I'm on Ubuntu), but in Academia this is a no-no; 2) I should STFU and start coding, and yet I cannot do this without a rational decision of why that particular language.

Has anyone actually gotten over this horrible illness? If so, what rationality did you use to choose a language?

+3  A: 

Yes. Coin toss.

The fact that you have choices in the first place means all the choices are good. Really good.

The actual final decision doesn't actually matter at all. Go to the TIOBE index. Pick one of the top 10 languages. You cannot go wrong.

S.Lott
What happened to "pick the best tool for the job"?
nikie
thanks. i did the tiobe, but i still have 10 choices :)
Dervin Thunk
You forgot to toss the coin.
S.Lott
@nikie: Since they're all **good**, there's no **best**. Toss the coin.
S.Lott
In particular, if you can't make up your mind among N choices, none is clearly bad, and any will do. Of course, if you randomly choose something you then decide you don't want, just remove that language from the pool. Sometimes being specific will make you think differently.
David Thornley
Staying with the tool metaphor: Hammers and screwdrivers are both **good** tools, there's no **best**. I still wouldn't use a coin to decide which one to use...
nikie
@nikie: There is no rational decision-making process among equally **excellent** alternative languages. All that's left is irrational. Programming is not quite the same as screws vs. nails, since all programming languages are Turing complete. The "tool" metaphor is a poor one.
S.Lott
@S.Lott: On the other hand, the "tool" metaphor, where hammers and screwdrivers are used randomly, would explain some of the software I've worked on.
David Thornley
@David Thornley: That's the DBA's policy: "We're holding the hammer, we're going to use it for everything." So RDBMS's are used inappropriately and people think "NoSQL" is an important and exciting innovation.
S.Lott
@nikie- I disagree, there *is* a *best* tool. It's called duct tape. If it can't be done with duct tape, then you aren't approaching the problem correctly. If only duct tape was also a programming language...
bta
A: 

well not quite so easy! However here's one test:

text manipuilation and processing ? (perl or python or ruby) : ( C or C++ or Java)

ennuikiller
The `numpy` people would object.
S.Lott
I'm sure they're not the only ones.....
ennuikiller
+1  A: 

It depends on the application you're building. Write down the things that are most important to your application, and then chose a language that fills most of these requirements. Think of things like performance, cross-platform, power of language, cost...etc.

Nada
A: 

Like any other decision you make in life. When you feel you begin to spend too much time pondering the question, just make a decision. Any decision. Roll dice, ask the wind, ask your local rabbi or priest or cartoon hero. If you can't make up your mind it's for one of two reasons: either it doesn't matter, or you truly don't know. In either case the only solution is to make a decision, as arbitrary as it may be, and never ever look back.

Well, not before the project comes to an end.

wilhelmtell
+1  A: 

Well to comply with the programmer spec of being lazy, for situations where all languages are equally acceptable, I just go with whatever is installed on the development machine :D

Xzhsh
+1  A: 

My personal rules of thumb:

  • if it's a small pet project -> use a language you don't know and want to learn
  • if there is a special-purpose language for the job (e.g. SQL for DB queries, YACC/ANTLR for parsing) use it
  • if the project involves complex algorithms, I would choose a functional language like OcaML or F# by default. (It's a rule of thumb. Some algorithms are easier to write with destructive updates, but generally I find that referential integrity, pattern matching, higher-order-functions, closures etc. make complex algorithms a lot clearer)
  • if it involves buffer manipulations (e.g. parsing a binary file format like jpeg) I'd use C or C++
  • if there seems to be an abstraction level that can't be captured with typical OOP constructs, use a language like Lisp, Scheme or Boo with syntax transformations, so you can build your own abstraction levels. Sometimes code generation is a good alternative, too.
  • For user interfaces, I'd use C# on Windows, Java otherwise.
nikie
I would add existing libraries to the second point. If a language offers libraries fitting for the problem, that can be an argument.
Space_C0wb0y
A: 

C# and ruby are the premiere languages of modern software development. Java would probably be the 3rd.

Chris Marisic
+1  A: 

In the comments you mention that academics choose to use prolog or lisp. You use C# mostly. Don't you think that you should pick a language that matched the problems you are interested in solving? I think that is where I would start. Look for the problems you try to solve, and find a language that fits.

Read Seven Languages In Seven Weeks, and find which language fits your needs best.

Jed Schneider
+4  A: 

I sometimes have that same problem. Here is the thought process I usually go through (in pseudocode):

if library_already_exists then
    use_language(library.language)
else
    if text_processing_required then
        use_language(some_scripting_language)
    else if raw_data_buffer_manipulation_required then
        use_language('C')
    else if CLI_program_interaction_required then
        use_language(select_at_random(['bash', 'TCL']))
    else
        # Just to keep things fresh ...
        if (random() & 0x07) == 0x07 then
            use_language(select_at_random(languages_I_dont_know))
        else
            use_language(select_at_random(languages_I_know))
        endif
    endif
endif
assert((language != 'java') and !language.requires_punch_cards)

The most important condition being the first one. If there is already a solution to the problem, use it instead of re-inventing the wheel. If the existing solution isn't something I can work with directly (say it's in a language I'm not familiar with), wrap it up into a library and reference that library from a language you're more comfortable with.

bta
To avert a flame war, don't take my `assert` as anything against Java other than it's a language that I'm not really interested in learning (it seems like a good enough language, it just never held my interest for some reason). Nor am I implying any equivalence between Java and punch cards. Although if someone designed a JVM that would run Java code written on punch cards, I would teach myself Java just to use it....
bta
Since I'm a consultant my flow is much easier. `if customer dictates language: do what customer says; else: use python`. All this complexity makes my head hurt.
S.Lott
A: 

Everyone always says pick which language suits you best. That's both correct and incorrect in my opinion. Some languages are better to use for certain tasks. Now, if you completely do not feel comfortable with that language, then everyone is right, go with what you are comfortable with, but if you have a range of languages to choose from, it's not always smartest to go with the one you know best.

What type of project is it, and what are you trying to accomplish? If you're trying to develop a Web Application and are already familiar with C#, use Mono and maybe develop an ASP.NET App. If you're trying to develop a desktop application, if you run Ubuntu look into putting something together with Python. Python is a very simple language to learn and there is a lot of good documentation out there for plenty of Python GUI Libraries.

It's all in what you want to build. Programming languages were built by people mainly because what they coded in, they didn't like. Why didn't they like it? Mainly because it didn't suit a given task as well as it should have. Remember that when picking a language.

Scott