Why do developers choose one programming language over another for a given task?

Sometimes I choose raw C when I need blazing speed.

When I want something that will run on Windows with as small a distribution as possible, I often choose C++ with MFC statically linked.

When we need a GUI that will run on Mac, Windows, and Linux, a common choice is Java (although the GUI will not be perfect, it will work.)

For rapid GUI development and really smooth UIs, I like Visual Basic, but I know that I’m going to have to pay the price in the size of the distributable and the fact that I’ll be locked into Windows.

For a command-line tool that must run on any UNIX machine and doesn’t need to be fast, perl is a good choice.

If you have to run inside a web browser, JavaScript is the really the only choice. In a SQL stored procedure, you usually get to choose between one vendor’s proprietary SQL derivative or go home.

What’s the Point?

But I hardly ever choose a language based on syntax. Yeah, I prefer the {}; languages (C/C++/C#/Java). And I have lots of opinions as to what makes a “good” syntax. But I wouldn’t accept a 20 MB runtime just to get semicolons.

Which makes me wonder a bit about .NET’s cross-language strategy. The idea is, choose any language you want, there are zillions, and they all work the same way.

VB.NET and C#.NET are virtually identical except for tiny syntactic differences. And other languages that want to be part of the .NET world need to support at least a core set of features and types or they won’t be able to Play Well With Others. But how do I develop a UNIX command line utility in .NET? How do I develop a tiny Windows EXE in less than 16K in .NET?

It seems like .NET gives us a “choice” of languages precisely where we couldn’t care less about it — in the syntax.

About the author.

I'm Joel Spolsky, co-founder of Trello and Fog Creek Software, and CEO of Stack Overflow. More about me.