
The Best Programming Language (or How to Stop Worrying and Love the Code) - alvatar
http://blog.fourthbit.com/2014/03/01/the-best-programming-language-or-how-to-stop-worrying-and-love-the-code#.UxRMIIfvkjI.hackernews
======
V-2
Based on the code snippet, I'm not surprised he thinks C# is "verbose" with
"lots of boilerplate" and "resembles Java", because the snippet is written as
if it WAS Java, or at least written 10 years ago. Compare his GetFrequencies
implementation with idiomatic, LINQ version:
[http://pastie.org/8834650](http://pastie.org/8834650)

~~~
mcv
I know nothing about C#, but I keep hearing announements of Groovy-like
features in C#, and to me, Groovy is what Java should be (but with better
performance). If C# is really like Groovy with better performance, then it
should be a very nice language indeed.

~~~
teh_klev
I've tinkered with Groovy (writing custom event handlers etc for Jira). If I
was going to spend any serious time writing stuff to run on the JVM then
Groovy would probably be my choice. C# has been my primary development
language since 2002. Fell out of love with it for a while until LINQ and then
dynamics appeared. Oddly, this week I am writing nagios plugin code in Perl,
which I am getting a weird kick out of, I haven't used Perl in anger since
1999.

~~~
kbenson
A few tips for the infrequent Perler:

If you have a more recent Perl available, use it and it's newer features (use
5.014; at least, hopefully). It's a small thing, but being able to call
keys/values/shift/unshift/push/pop on the reference versions of their subject
is very nice. There's _useful_ new features in every new version now.

Additionally, Function::Parameters (or some other module that does similar,
take your pick) will make your life much, much simpler if you tend to write a
lot of subs.

Use Moose (or at least Moo or Mouse, if you want it lighter weight) if you are
using objects.

Enjoy!

------
stinos
Some nice angles in the article, but now I feel obliged to defend C++ (and
actually C# and F# too, but I'll let that to others as I'm sure it will turn
up in the HN comments) since the author seems to make no _real_ points to
support his view of it as a monster.

First of all, it's not because x [1] and y and a bunch of others say that "a
== true", you can safely use it as a fact or a way to support your view (those
logical fallacies are called Bandwagon Fallacy/Appeal to Authority).

Second: I don't know where those code samples come from, but that is not
exactly how you write good C++, as it is called in the paragraph. And a
paragraph lower there is mention of the dreaded _C /C++_ \- a thing that does
not exist, never has, and never will. Some might say that adds to the author's
points (as in, it's so hard he doesn't know how to write it properly), but you
might as well say: sorry, but if you don't know how to write it properly then
you do not really have the bagage needed to start criticizing it let alone
calling it a monster.

[1] esecially when x is called Linus and he's in one of his rage moments where
every single being that does not think alike is violently insulted and reduced
to the dirt of the earth, with or without arguments making sense :]

~~~
andrewcooke
i guess maybe now is a good time to repeat this request - does anyone know of
a good, recent book that describes how to write correct, modern c++ using the
latest standards and staying with the subset of the language that expert users
recognise as elegant and powerful?

~~~
polskibus
I always recommend Effective C++ by Scott Meyers. It does not cover C++11 but
is still relevant to anyone wanting to learn the good c++.

~~~
jtfrench
I would have to second that. Scott's book is great (and he's a fellow Brown
alum)

------
V-2
I love how F# is among the "unreasonable languages". Why? Because it's
"Microsoft trying to be cool", "many of us have learned to keep away from
Microsoft the hard way" and "we have enough company-sponsored languages
already". That's it.

~~~
collyw
I was surprised by that one, as I have not tried it, but it does sound like
one of Microsoft's nicer efforts when I read about it.

~~~
hvidgaard
I have only played with it a little, but so far - it's like OCaml, with a "MS
Approved" badge.

------
bromagosa
«The first true object-oriented language. But it seems to me Smalltalk is
pretty much a forgotten language.»

Why do so many people kill Smalltalk so fast?

I could give so many URLs to illustrate how Smalltalk has a stable and growing
community, with so many open projects and people making a living out of it,
teaching it in universities and using it for research, but I think these two
links sum it all up:

[http://forum.world.st/](http://forum.world.st/)
[http://smalltalkjobs.wordpress.com/](http://smalltalkjobs.wordpress.com/)

~~~
overgard
> Why do so many people kill Smalltalk so fast?

Because it doesn't have curly braces. Entirely unfair, but it seems like if
you want to sneak in an innovative language it needs to be a wolf in sheep's
clothes. (IE: it need to vaguely resemble C)

~~~
Kurtz79
I could make an argument for the exact opposite.

If a new language has curly braces is instantly reviled and deemed as "not
innovative" by part of the community.

~~~
AnimalMuppet
I think both are true, because "the community" is not one thing. It's a bunch
of people, each with their own viewpoint. And a bunch of people have strongly-
held views (in both directions) on curly braces.

------
klibertp
> First of all, a disclaimer: unless you’ve developed in 30+ languages, and
> suffered the code of others in all (or most) of them, you can’t really be
> objective. So yes, I’m biased. Like most of the people writing about this
> topic. Actually, I believe that this topic becomes absurd as soon as you are
> well-versed in many languages.

I fully agree with this sentiment and I wish more people either already had
30+ languages experience or at least realized that most of what they say now
will sound stupid to them once they got this experience.

------
isxek
No mention of Lua? I guess the author hasn't tried it yet, either. (I haven't,
but I was curious about his opinion on the language.)

~~~
Tomis02
After years in the C++ swamp, programming Lua feels like being a world-class
sprinter. Sure, there are places where it could be less verbose (the
'function' keyword, if-then-end), but overall it's liberating to have so much
power with so little typing. Ok, it's a visceral (not technical) impression,
but there's plenty of places to read about Lua online. I highly recommend
giving it a try.

------
amirmc
For OCaml, there are many more companies using it than just JaneStreet.
Facebook and Bloomberg being some of the well known ones.

[http://ocaml.org/learn/companies.html](http://ocaml.org/learn/companies.html)

~~~
pjmlp
Including Microsoft, which many aren't aware of.

~~~
amirmc
They're also a member of the OCaml Consortium, too

[http://ocaml.org/community/support.html#TheCamlConsortiumatI...](http://ocaml.org/community/support.html#TheCamlConsortiumatInria)

------
MisterMashable
Have you ever seem a simple Prolog program solving the 'four coloring
problem'? Try programming that in anything else. Prolog or something similar
like Lisp with pattern matching is the tool of choice for speech recognition
programs. Why these tools get dismissed in a world of tablet devices using
Siri or Google is beyond me.

~~~
dmunoz
I'm not sure I agree with this line of reasoning.

The computation model of Prolog is fairly simple, relies on few primitive, and
could be reimplemented in many language without much hassle. The abstract
interpreter fits on a 1/4 page.

With unification and backtracking, you're into nondeterministic programming.
It's great for some problem, and I agree it should perhaps be more regarded
than it is, but it can be emulated inside other languages to solve such
problems. You also have to be quite careful when using non-determinism.

That being said, my main point is that I think the "simple Prolog program
solving" X is misleading. Of course a solution to a problem that requires
exactly the model of computation the language provides is going to be simple
in that language. But that model of computation isn't exclusive to that
language, and I don't feel the implementation of the model in other languages
suffer.

------
mbillie1
It's a bit sad that we keep reading these articles and keep falling into the
same trap of rush-to-defend-your-favorite-language and rush-to-complain-that-
your-favorite-language-was-omitted. I find these articles seldom thought-
provoking and the comments they inspire even less so. It's like reading "10
best ski runs in the country" or something. It's entirely subjective and
hardly anyone will agree for any decent set of reasons.

------
mcv
No Groovy? If you want to address which is the best JVM language, you've got
to at least mention Groovy. Its advantages include being trivial to learn for
the vast hordes of Java developers, while making programming a lot more fun in
a Ruby-like way.

When to use it? When you want the JVM, and productivity is a bigger concern
than performance.

~~~
vorg
> If you want to address which is the best JVM language, you've got to at
> least mention Groovy

You could make that argument for all of the many ecosystems mentioned in the
article, e.g. because for Unix/Linux scripting only bash is mentioned, you
could have opined _" If you want to address which is the best Unix shell,
you've got to at least mention zsh"_.

Groovy's just a dialect of Ruby anyway, except being specific for one platform
and having a different syntax. All the functionality underneath the syntax is
based off Ruby, and even its two applications with any traction are based off
Ruby versions. The MOP was put in in 2005 specifically for Grails, which
started off as a launder of Rails.

~~~
mcv
Grails is a bit more than simply Rails for Groovy. There are a few things that
Grails does very differently, partly due to it being built on top of Spring
and Hibernate.

Also, Groovy+Grails is far more enterprise-ready than Ruby on Rails. Something
as basic as proper unicode support is still very recent in Ruby, for example.
Also, multithreading comes as naturally to Grails as it comes to Java, but not
to Ruby on Rails.

They are absolutely very similar, but there are important differences that go
a lot deeper than just the different syntax.

~~~
vorg
> There are a few things that Grails does very differently, partly due to it
> being built on top of Spring and Hibernate.

Back in 2005 Grails didn't add much to Groovy, Spring, or Hibernate. It was
just a thin wrapper around software products from other companies (e.g.
SpringSource, JBoss) so the training consultant behind it all could muscle in
on the training and consultancy markets for their products. In 2006 Grails was
renamed and promoted as _Groovy on Grails_ to sound like _Ruby on Rails_. He
started a company, G2One Inc, in 2007 and quickly shopped it around among the
various companies whose products he bundled, successfully fooling SpringSource
into buying it 12 mths later.

------
michaelfeathers
Progress is when languages move from the unreasonable list to the reasonable
list. I was happy to see Haskell there. I don't think it would've been 5 years
ago.

------
nzonbi
This was an excellent article. Agree with the author on many points. Some
notable mentions:

\- Scheme: One of the best languages. A shining example of the beauty of
simplicity. I personally envy folks that got to learn programming with SICP.
Unfortunately, I didn't crossed with the SICP as a kid, when I would probably
had devoured it.

\- Haskell: possibly the most advanced programming language, with the downside
of having way too much syntax.

\- Opinions on programming languages are biased most of the time. Significant
experience with dozens of languages is required, to diminish the bias.

~~~
sfvisser
Haskell too much syntax? That's a very weird claim. Haskell's syntax is one of
the leanest around.

You could even argue the lack of syntax can be confusing sometimes. Beginners
often mix up types, patterns and expressions, because there isn't a huge
syntactic difference.

~~~
thinkpad20
Yeah, that surprised me as well. There are declarations of types and classes
etc which are a bit confusing at first, and then there are `do` and `case` and
the like. Certainly not a lot though, compared to say C++ or Scala. I think
what might make it appear more difficult is that it's just so different from
almost anything else out there, so it's not just that there's a bit of new
syntax to learn, but that almost nothing that you've learned in other
languages will be applicable.

~~~
nzonbi
That is more or less what I mean by Haskell having too much syntax. Let me
start by saying that I am far from an expert, and I am just expressing a
subjective opinion. I would welcome if anyone shows me that I am wrong.
Haskell is a brilliant language. Yet I have this personal and completely
subjective opinion. When using Haskell, I get the feeling that the different
syntax constructs, just don't fit too well conceptually among them.

The language on the whole is far superior to most others. Yet the syntax
constructs don't feel to fit elegantly to me. It is not just that purely
functional is a completely different paradigm. It is that the actual
implementation lacks a global conceptual elegance. I am going to give an
actual example: Take pattern matching. That is a nice conceptual idea. You can
pattern match in function, and it is great. But then, you can also pattern
match in list comprehensions. So patter matching can be combined in two
completely different operations. This does not feel elegant, it feels awkward.
It is not very obvious where pattern matching can or can not be used. Haskell
is full of things like this.

This lack of overall elegance, makes it harder to mentally handle and become
agile with the language. It takes more effort, so it feels that the it has a
substantial cognitive overload. Maybe this is completely fine, and is required
for the benefits of purely functional programming. Or maybe there could be a
different, more elegant implementation of a purely functional language.

Or maybe I'm just biased by a lack of extensive experience with dozens of
languages. As a fun note, let me add that as a side project, I am currently at
work on a programming language, that address these things that I see as
problems. It is not a purely functional language that aims to compete with
Haskell, but it happens to address the issue of lack of overall elegance, that
I am describing here. I currently have a conceptual design for a type system
that specifically aims for conceptual elegance within the whole language. Also
it happens that this language will be a graphical language, instead of text
based. At worst it will be a great learning exercise for me. I hope that it at
least end being an interesting curiosity.

------
pcwalton
> If there is something that could debunk C is a low-level language with great
> support for concurrency. Or maybe a mythical language with the properties of
> Haskell and the pervasiveness of C.

So, Rust? :) (Minus the pervasiveness, right now—but you do have the low-level
control.)

------
santialbo
If by "F" the author means F#, he has no idea of what he's talking about. The
language is open source with an Apache license.

~~~
isxek
Yup, it was F#.

------
onli
The bash-example is not very bashy. It is sh, like the header says. Bash fully
supports a native for:

    
    
      for i in {0..5};do
          echo "$1"
      done

~~~
xcreature
Interestingly, this comment states that Bash is not available in all POSIX.
Here is where I get lost. [http://blog.fourthbit.com/2014/03/01/the-best-
programming-la...](http://blog.fourthbit.com/2014/03/01/the-best-programming-
language-or-how-to-stop-worrying-and-love-the-code/#comment-1268486352)

~~~
onli
Yes, that is correct. Bash has additional functionality (and the for-loop I
showed could very well be a part of that). If you want posix, better stick to
dash, the code he showed.

But bash with its additional features (like associative arrays) is much more
comfortable, so if you know you can use bash - because the target is GNU/Linux
- it is a good idea to use them.

~~~
dllthomas
Sh has for; it does not have the {a..b} construct. But you can write it as:

    
    
        for i in `seq 0 5`; do
            echo "$i"
        done
    

and that will work perfectly well on dash.

------
wes-exp
I'm sorry Common Lisp is not elegant enough for the author, but it has a great
community and library support. (At least compared to scheme)

Efforts are also underway to spruce things up a bit.
[https://github.com/fukamachi/cl21](https://github.com/fukamachi/cl21)

------
nhmit
Whenever someone says PHP is useless I know that they have no idea what they
are talking about. Being ugly is one thing, being useless is something quite
different and in case of PHP this could not be further from the truth.

~~~
timje1
Strange, this article doesn't call PHP useless.

~~~
Gigablah
It does. Every line about PHP was sarcastic :)

~~~
jbeja
As my comment above ;).

------
pjmlp
C, or how to keep your job safe as security consultant.

------
rottyguy
A bit surprised by how much attention this article is getting here. Someone
nailed it by saying it has much breadth but little depth. A speed dating
synopsis of competing programming language to speak. Obviously the author
likes brunettes with fair skin.

I recall reading the "Design and Evolution of C++" and found it quite
enlightening. One wishes this type of book was a mandatory delivery for all
Language authors...

------
edem
Clojure is definitely __NOT__ a sibling of Scala. Being a sibling of scala
would mean that it is something like C to C++ or Java to Ceylon.

~~~
dagw
It's a half-sibling, since they share a parent (JVM).

~~~
pessimizer
More like roommates, because they share a house.

~~~
aryastark
It's more like a brothel.

------
skywhopper
That's a big list. A relatively inexperienced programmer looking for advice on
what language to start with would probably be overwhelmed. How to choose what
language to learn next? There's a dozen languages they've never heard of on
there.

Glad to see Bash on there, even if his example code was sort of misleading.
Sure, you have to be able to read that stuff, but if you can rely on Bash
being there, you can use better syntax.

Anyway, Bash (and other similar shells) is special because it's the glue that
ties a Unix system together. No other type of language can construct the same
kinds of pipelines and filters so concisely or interact with the filesystem so
easily. For a certain set of problems, Bash is by far the best option. The
ugliness is partially legacy, but mostly just necessary to allow the same
language to work at the command prompt without overloading everyday CLI usage
with a ton of pointless syntax. It's all about tradeoffs, kids.

------
thelogos
People should first decide what they want to achieve, produce mobile, web, or
desktop applications, etc.

Then they should find the best framework to achieve their goals. The language
is usually force upon you by the framework unless you're working on something
cutting-edge.

In the past, when I set out to learn a programming language, I would always
get nowhere. You learn the syntax from some book, do the exercises, then what?
Without a solid goal to hack toward, pretty soon, you will forget everything
you've just learned.

------
greenonion
Regarding the Go vs. D argument and Google beeing behind Go, Facebook seems to
be using D [http://www.drdobbs.com/mobile/facebook-adopts-d-
language/240...](http://www.drdobbs.com/mobile/facebook-adopts-d-
language/240162694)

~~~
voidlogic
Sure, but that doesn't mean both organization are equally committed to each
language. Google has an entire team that works on Go full time and all their
work is donated to golang.org which is opensource. Its not clear that Facebook
is more than just a D user at this point.

I also have a seeking suspicion that Facebook never considered using Go
because of Go's close Google ties, maybe if they didn't feel Google was a
competitor they would have went with Go over D- we will never know.

~~~
axaxs
As I understand it, they didn't 'go with D over Go' so to speak. They employ a
fanatic of the language who wrote a piece in D, presumably with approval, and
used it. There's nothing wrong with any of that, and I hope it works well for
them. But I wouldn't say it was exactly chosen in advance for its merits,
other than having an awesome programmer in the language, which can be one of
the biggest reasons at times.

------
emersonrsantos
No love for mumps?

GREPTHIS() NEW SET,NEW,THEN,IF,KILL,QUIT SET
IF="KILL",SET="11",KILL="l1",QUIT="RETURN",THEN="KILL" IF IF=THEN DO THEN
QUIT:$QUIT QUIT QUIT ; (quit) THEN IF IF,SET&KILL SET SET=SET+KILL QUIT

~~~
al2o3cr
(grumpy cat) NO

------
jstultz
"[Java]’s used for everything, from web apps to games. Almost everything
except embedded device software, and perhaps high performance parallel
computation software."

Apparently hasn't ever heard of Embedded Java or Hadoop

------
jbeja
First time that i ever heard that Scheme compile to c and js.

------
chrisBob
I thought the best programming language was the one with the libraries I need
(usually from the hardware vender of the card I need to interface with).

------
tbomb
Nice read, pretty entertaining round up. I like the use case lists (I think
they added most of my entertainment), and overall tone of the article.

------
sov
I wrote a context switch in assembly pretty recently, so,, it's not entirely
unused. It's still in quite a bit of our C code.

------
romanovcode
tl;dr

Author loves javascript.

~~~
jbeja
Your point?

~~~
romanovcode
His opinion is biased and he doesn't know what he's talking about.

~~~
jbeja
Because he likes javascript?

~~~
pekk
To the exclusion of other things he doesn't know anything about

------
supersystem
If you actually want to make things you'll still can't avoid learning C, C++,
Java and/or Objective-C. Other languages just don't offer a broad enough
ecosystem.

~~~
vinceguidry
You can get very far with Ruby or Python before having to learn a bit of C for
extensions. I've been using Ruby for years and I've yet to run into a
situation where I need it, though admittedly I stick to web stuff.

~~~
supersystem
Don't get me wrong, I'm a big fan of high-level programming languages. But
things like threading, graphical interfaces, multimedia, embedded programming,
binary distribution etc. just isn't very well supported. Partly because of
technical challenges, but mostly because there isn't a critical mass of people
doing those things.

------
ternaryoperator
Surprised that Lua did not make the list.

------
michaelochurch
I'd use Clojure over Common Lisp any day of the week, but I'd never call CL a
"dinosaur language". It's still getting a lot of use, and it's still a better
language than what 90% of programmers have to use in their day jobs.

I like one point he made about Clojure's real killer strength: it works for
exploratory code _and_ in production. You don't have to use one language for
data analysis (e.g. R) and another one for your production servers (e.g. Java)
which means that the data-science/production-engineer impedance mismatch need
not be as severe. Here's a presentation I gave on that aspect of Clojure (note
the Venn diagram):
[https://docs.google.com/presentation/d/15-7qFy6URdE7Owi2Litk...](https://docs.google.com/presentation/d/15-7qFy6URdE7Owi2LitkQI_OHBu1AFWPUwHxgBc-O4E/edit#slide=id.g17bb5960b_10315)

On Haskell, he says: "This language truly feels as a more advanced thinking
tool than the others in this list. It has libraries for almost any need and it
has a hard-core community."

You know, a few years ago I looked into Haskell and thought, "this language is
_amazing_ " but wrote it off because (a) it didn't seem to have the libraries
for "practical" corporate programming (CRUD apps) and (b) the political fight
to get to use Clojure at your job is at least _theoretically_ winnable due to
the JVM; for Haskell, it's not winnable until you _are_ the architect or boss
man. I like static typing a lot (I used Ocaml at Jane Street for a year and a
half) so Haskell always seemed appealing, if not practical for "most kinds of
work".

I'll probably stick with Clojure and Scala, because I'm not yet at that point
in my career where I can use/do whatever the fuck I want, but I'm inspired to
look into Haskell more.

A few people recommended I check Haskell out again. The community has made
major strides (or, to put it more directly, it's kicking ass). I spoke to
@cartazio about it the last time I was up in New York and he made a really
convincing case for Haskell being ready to tackle the hardest of the hard
problems (e.g. machine learning problems where performance _and_ high-level
code are both needed).

~~~
agentultra
> I'd never call CL a "dinosaur language".

It's a dead horse and people can't help but beat on it as they pass by.

I wouldn't call it a dinosaur language either. The specification of Lisp that
we call, "Common Lisp," was ratified by ANSI in 1994 -- putting it almost
neatly between ANSI C (1989) and ANSI C++ (1998). Common Lisp just has a
longer history than those two languages so it tends to get flack from the
young'uns and ignoramus' for being, "old and crufty."

It's a small community but there are plenty of libraries, tools, and compilers
under active development.

------
kjs3
«[Smalltalk] The first true object-oriented language.»

Simula-67 would like to have a word with you...

------
CmonDev
Please check your facts before posting to avoid being a clueless moron: C# is
not just a static language it supports dynamic typing, C# is not just an
object-oriented language it's a functional language as well.

The post is downright offensive to C# developers.

EDIT: ok, I figured it out - it's a troll post to stir the HN community a bit.
Lot's of other good languages get undeserved bashing.

~~~
mikegioia
For PHP he comes out of the gate saying "Don’t just assume PHP is horrible."!
Apparently the ONLY redeeming quality of PHP is the vast number of developers
who know PHP?

~~~
camus2
Yes PHP is horrible,but it is usefull,otherwise nobody would use it.It has
excellent libraries for "traditional" user facing websites. It's clearly not
meant to do anything else.

------
platinumdragon
Wow, amazing article! Thanks!

