Ask HN: How do you choose the programming language for a project? - happy-go-lucky
======
gdulli
I choose Python because it's the only one I enjoy. Around 2008 I was losing
interest in being a developer. I'd used Perl, Java, C, PHP, Javascript, VB/ASP
for various jobs and there wasn't anything I enjoyed using anymore. I started
to doubt if I was in the right profession. It wasn't fun as it once had been.

I learned Python and it made me enjoy writing software again. 8 years later
and it's nearly the only language I use. In principle it makes more sense to
choose the right tool for the job, but if I don't enjoy doing the job with
other tools, it makes sense to plan around the tool.

I avoid mobile or front-end web development because Python isn't the right
tool for those jobs. Fortunately, I like server-side development and data
engineering and Python fits perfectly there.

~~~
codegeek
I love Python but one of the issues with python has always been deployments on
a server. I know there are things like docker etc nowadays but still, it is a
lot harder to deploy than say a PHP application.

~~~
gdulli
I've never felt that to be a pain point or really understood what people mean
when they mention it as a pain point.

Whatever weaknesses Python has either don't affect me because they don't
intersect with the way I work, or else I easily work around them in ways that
don't feel like compromises to me. But I can understand how someone else could
say the same things about a different language.

~~~
bckygldstn
Not my comment, but for small projects I can see the appeal of putting some
.php files into apache's /var/www/ and you're good to go.

With Python you need to choose a framework, choose a wsgi server, and hook all
that together with nginx.

~~~
davelnewton
You don't really, though. You _may_ , and you'd be better off if you _did_ ,
but you can throw up a simplistic HTTP server without needing to do any of
that.

------
greydius
There are a lot of variables that go into this decision.

First of all, is this a solo project or is a group of people going to be
working on it? If it's a solo project, then you are far less constrained. If
it was a small proof of concept or otherwise throwaway project, I'd probably
use it as an opportunity to try a new language. If it's a real deliverable and
doesn't involve hard real time performance, I'd choose Haskell because it's a
language with which I'm proficient and I enjoy using.

If this project is going to be developed and maintained by more than just
myself, then the story changes. With an existing group of developers, you have
to play to their strengths and get buy-in, so use either a language they
already know, something similar, or something they've shown an interest to
learn. If you don't yet have developers, consider the difficulty of hiring for
certain technologies. There are also performance and correctness requirements
to consider.

If you happen to be an enterprise decision maker (which is unlikely since this
is a community for intelligent critical-thinkers) then the only correct choice
is Java. No one gets fired for choosing Java. There's a framework for
everything. There are plenty of cheap developers. It's popular, so it must be
good.

------
framebit
It's like asking what tool should I use for my construction project. Well, are
you pouring concrete? Are you doing electrical wiring? Are you working with
wood? Are you painting?

Want to build an operating system in Ruby? Ok, good luck trying to pour
concrete with your tablesaw.

Admittedly, that analogy is a little extreme since programming languages are
Turing complete, etc etc. However, if that's your perspective, you may want to
have a gander at Cobol on Cogs:
[http://www.coboloncogs.org/INDEX.HTM](http://www.coboloncogs.org/INDEX.HTM)

------
davelnewton
1) Do I/the team know it well enough to be productive?

2) Does it suit the nature of the problem?

3) Does it have a large enough ecosystem to address my/our needs?

4) If it doesn't, do I/does the team have enough time to fill in the holes?

5) Can it be deployed in a reasonable way?

------
jetti
It depends on a few factors.

First, what is the type of project? If desktop, then C#/WPF (since my desktop
apps will always be Windows). If web, then the choice becomes more complex.

For web, am I going to be solo? If so and there isn't a compelling reason to
pick a specific language (be it because of its strengths in a specific area or
environment constraints) pick whatever language I feel like learning or
already know (if it needs to be rushed then pick a language I know).

If I'm doing web and going to have a team, then pick something that I find
interesting, that fits the needs of the project and I can find people if need
be. I'm currently working on a project that is just me but will eventually be
a team of people (somewhere down the road). I chose Elixir/Phoenix because it
is something I want to learn and there is no specific reason for picking some
other language. I've heard enough about Phoenix and Elixir to know that I
could find some Ruby/Rails devs to teach them Elixir/Phoenix if I wasn't able
to find elixir devs, so making a team isn't a big deal.

------
cauterized
Is the purpose of the project to learn a specific new language or framework?
Problem solved.

Does the project involve certain functionality that's already been solved in a
framework or library available only in one language (or at least not in any
languages that my team and I are already proficient in)? Will it be faster for
me or my team to learn that language thoroughly than to reimplement the
functionality?

Is the project being implemented on a platform that only supports a limited
set of languages officially (e.g. iOS or client side web development)? Pick
the most widely used of those.

Otherwise the project gets done in the language I enjoy most and am most
proficient in (for personal projects). Because that'll be the most fun for me.

Or the language my team collectively knows best and were hired for their
knowledge of. Because that makes knowledge transfer and future maintenance
easier.

------
Macha
If there's some compelling library or specific reason to use a certain
language: That one

Else if it's for work: Java and/or JavaScript

Else Python

~~~
sidcool
If Big Data related, then Scala. If station then R. If small web app then
Ruby. If scientific then Python.

------
sheraz
Easy. Which programming language is best at running Django? Ah, python it is
:-)

~~~
collyw
For > 90% of my needs its the same.

------
imauld
For personal projects I pick between Python and Go. I ask myself some
questions before I pick, in no particular order:

\- How complex is the thing I wanna do? If it's very complex I'll go with
Python since I'm much stronger with Python than Go. This allows me to focus on
the problems I'm trying to solve not the ones I create by misunderstanding
something in Go.

\- What are going to be some of the key features I'll need from my tools?
Concurrency is not a strong point of Python so something that requires it may
be better off in Go. Am I going to need auth, email sending, an ORM? Django is
great for getting that crap out of the way so I'll probably use Python.

\- How much new stuff will I be learning for this project? Most of my personal
stuff is done as a learning exercise. I have found in the past I tried to
learn too many things at once and I would just end up lost.

These are just some of the things I think about before choosing a language.
However, your milage may vary of course. What ever questions you ask yourself
you should always keep in mind the strengths and weaknesses of your options
and whatever you do end up choosing you keep those strengths/weaknesses in
mind and work to make the most of the strengths and use other tools/processes
to mitigate the weaknesses.

------
LarryMade2
Depends on the project - so many factors

Desktop or Web? Data, Graphics, Game or something else? Who is the audience?
Need to be expendable? Platform specific or agnostic? Input/output
considerations? Single user, centralized or distributed data? If
Internet/network what sort of connections will you need to support AS A
MINIMUM? If planning to use commercial tools, can the audience handle the
distribution/licensing requirements, costs? Update considerations - if a
closed source single user, consider how updates will deploy in the platform
you choose. Any special hardware you plan to use (i.e. pinpad, signature
digitizer, fingerprint scanner) these will be a BIG factor on what you choose,
sometimes such devices will narrowly define what is usable.

Many of these are not much a problem by using more tried and true
languages/platforms than something new as many of those issues have solutions
you can just Google an answer. Going toward the newer/shinier platforms might
get you an edge in some feature but may completely ignore other factors.

------
AnimalMuppet
I chose Java. Why? Well, three specific things made that specific task much
easier - polymorphism, reflection, and garbage collection. And I knew Java.

The reflection part I could have gotten around fairly simply, but I'm happy
with how cleanly it worked with reflection. Polymorphism was a must-have, and
garbage collection was close (it might have doubled the amount of work if I
didn't have it).

~~~
davelnewton
No issues with choosing Java (used it for years), but I would argue that OO
and reflection aren't great reasons for specifically choosing Java.

~~~
AnimalMuppet
To get that specific set (OO, reflection, garbage collection), what would be
your choice?

~~~
davelnewton
Just about any other OOP language.

I don't find reflection itself to be particularly helpful, e.g., the only
times I used it in Java were during low-level framework creation and code
generation. Anything else is better handled via interfaces or similar
functionality.

But if I were forced to use the JVM (which is a nice platform) I'd tend
towards Clojure (distinctly not OO). If OO was a strict requirement then
Groovy or Scala.

Java's OOP implementation, however, is fairly limited in scope, although Java
8 has somewhat alleviated my own particular pain points (e.g., lambdas).

~~~
vorg
> I'd tend towards Clojure. If OO was a strict requirement then Groovy or
> Scala

Use Scala for building systems that actually require the OO structure. Use
Apache Groovy for glue code and tests, and other scripty stuff like build
scripts for Gradle.

------
khedoros1
Most of what I've done professionally has been C++, which suits me because I
actually like the language. That was chosen because the system in question was
designed in about 1998 and has accordingly grown in scope during that time.

I've used Perl and Python for small applications and glue code. I liked Perl
for a long time, but I don't want to go back to it after using Python.

Most of my personal projects are written mostly in C++, sometimes with bits in
C, because they're suitable for emulators, game engines, renderers, Arduino
programming, and robot control code and because (as previously stated) I like
working with them. I've been meaning to start some things in Rust, but haven't
gotten around to it, in any serious kind of way.

I choose employment based partially on what language they're working in.
Systems-level stuff on Linux? Probably C or C++, so I'll probably be happy.

------
gravypod
There are concerns that go into this

    
    
       1. Your time
       2. Machine time 
       3. Others time 
    

Balance those three. Your time is saved by finding a language they already had
good tooling and libraries for your task. Machine time is saved by picking the
fastest language for this task. Sometimes you want a jit sometimes you need
native code because you're running embedded. Others time is spent maintaining
the stuff you build so using a language others already know saves them time.

Balance those three to find what works. Need really fast code? Sacrifice your
time and co-workers time. Need really maintainable code? Sacrifice your time
and machine time. Need really quickly written code? Sacrifice machine time and
co-workers time.

------
stolk
Step 1: You choose C. Step 2: There is no step 2.

You can keep it simple.

~~~
vram22
Me like :) and me is a C guy. But the same can said by anyone for any language
they like (Step 1.5 :)

------
danielvf
Mostly based on the strengths of the team that will be growing and maintaining
the project.

------
chillaxtian
1) is it a client side application? use the native language

2) use java

~~~
davelnewton
I'd argue the instinct to go native for desktop apps is no longer valid
without taking other things into consideration--it depends entire on the type
of app. There are compelling desktop choices besides native.

------
ryanmccullagh
My personal projects for the past ~3 years have been systems level projects,
so I choose C, naturally.

------
fishtaco000
If it is internet facing you probably would do yourself a favor and write it
in a secure language like Rust.

Otherwise C# is easy and reliable. Less secure than Rust, but less of a
concern if it doesn't face the web.

