views:

3422

answers:

31

Following on from Teifion's recent post "Easiest language to start with", I'm interested in the community's thoughts on what is generally considered the hardest programming language to learn. Something of an elitist's dream to be able to mention at geek cocktail parties.

I'm not just talking about ones with the strangest syntax, but also the ones that have the most bizarre overall concepts! Are there any really scary ones out there?

+2  A: 

I think any non-memory managed language is significantly more difficult than the others. Most languages that are are not that har dto go between, but adding memory management makes more difficult

Adam Lerman
+15  A: 

I've never tried to but BrainF**k?

E.g. (from the linked wikipedia entry)

Hello World

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

which can also be wrtten as:

++++++++++
[
   >+++++++>++++++++++>+++>+<<<<-
] this loop sets the next four cells to 70/100/30/10 
>++.              print   'H'
>+.               print   'e'
+++++++.                  'l'
.                         'l'
+++.                      'o'
>++.                      space
<<+++++++++++++++.        'W'
>.                        'o'
+++.                      'r'
------.                   'l'
--------.                 'd'
>+.                       '!'
>.                        newline
John Nolan
The question did say "not the strangest syntax"; conceptually brainfuck is fairly simple. It's more or less write-only, but that's not really a learning issue.
Mark Baker
Brainfuck is actually really easy. It takes a whole lot of time to write something useful, but hard? Nah.
Douwe Maan
+1  A: 

The hardest language to start with is the one you don't know.

[Sorry. Obvious answer.]

ColinYounger
+9  A: 

Intercal

http://www.catb.org/~esr/intercal/

Andrew Grant
http://en.wikipedia.org/wiki/INTERCAL - I like the `COME FROM` statement.
Thorbjørn Ravn Andersen
+1  A: 

Brainfuck's an interesting one. Assembler can be weird, too, especially if you haven't done any stack-based programming before. APL is another one. Then there's Haskell that gets a lot of concepts from category theory which is itself one of the lesser known fields of mathematics.

Mark Cidade
My experience is that assembler is one of the easiest. APL is hard because it's so hard to read. If you get lost in the middle of what you're doing, you have to start over (at least as a beginner).
Nosredna
+2  A: 

I found Erlang to be daunting the first time I looked at it. But then I looked at it again after learning OCaml and playing around with functional programming, and it made a lot more sense.

APL was pretty difficult to learn, but I haven't used that since college.

Forth took a while to get comfortable with, not because it is too complicated, but because it is too minimal.

Kristopher Johnson
+3  A: 

For me, LISP was the hardest to grok. Its amazingly simple and powerful, but a major shift in thinking from procedural languages like C. Also, as far as elite geek-cred goes, LISP is a classic.

Joseph Sturtevant
+1  A: 

I think that Lisp and like languages are the most difficult to learn. For me the biggest problem is that, well, the syntax for most of the languages can be downright fugly. But that's just my opinion.

Jason Baker
+25  A: 

Whitespace.

Hello world:

   



















































Will
I think you have a whitespace missing up there :-)
ldigas
That's not whitespace. That's blankness.
Nosredna
+16  A: 

The answer to this question depends on how you learn computer languages.

For instance, many people struggle with Lisp and Prolog because they are so much different from procedural and object-oriented languages. Other people have no problem with them.

I've been told ADA has a bit of a steep learning curve when you take the whole language into account: strong typing, run-time checks, parallel processing support, etc.

Haskell is another language that is criticized for being complex. It includes several interesting features, such as currying (breaking down an n-tuple function into several functions with a single argument), list comprehension, and others.

I'm sure there are others, but those are the ones that I'm aware of that people struggle when learning.

Edit: Kristopher reminded me that Erlang should be on this list of mine.

Marc Reside
+16  A: 

Definitely English

palmsey
+2  A: 

Another esoteric programming language, similar to Brainf##k, is (programming_language)">Whitespace. In Whitespace, the compiler ignores all characters other than space, tab, and newline. Similar to Whitespace and Brainf##k is Ook, which is the only language that I know of designed to be readable by orangutans. The three operators in Ook are: Ook. Ook? and Ook!

Burton
A: 

Part of it would depend on what you already know. If you are used to procedural languages, pure-functional languages like ML use require thinking about different kinds of algorithms to do work without using side-effects.

Prolog is also an unusual language in that you program with rules and data and then ask questions that get evaluated.

I've also found that Forth was difficult but fun to learn due to it's stack architecture.

crashmstr
Nit -- ML is not a pure functional language. the 'mutable' keyword and ref cells carry state. A better example of a pure functional language is Haskell or Scheme.
Joel
+24  A: 

Malbolge, named after the eighth circle of hell in Dante's Inferno, the Malebolge.

Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. The program was not even written by a human being: it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp.

And here's "Hello, World.":

 (=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**
 hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O<
HoboBen
This certainly gets my vote: "After each instruction is executed, the guilty instruction gets encrypted (see below) so that it won't do the same thing next time, unless a jump just happened."
Andreas Magnusson
I don't even consider that a language - there are programming languages, and there are experiments that somebody made out of their perverse delight.
ldigas
-1, because by language one usually understands means of communication. Malbolg is far from means of communication, it is very effective in hurting eyes instead
Valentin Vasiliev
I like how the program starts out with a nice =<
Chris Cooper
The first significant Malbolge programs were written by genetic algorithms in Lisp. (See the original Hello World, or rather HEllO WORld, at http://www.acooke.org/malbolge.html) In fact, I'm not sure it's *possible* to write a program in Malbolge without substantial computer aid.
Jon Purdy
+3  A: 

All those esoteric languages look like childsplay next to malbolge: Malbolge.

  • It's not binary, but uses a base-3 system.
  • Its syntax is hard, like all of the above, but the shift in thinking is a far greater penalty.
  • It has not been proven to be Turing complete yet.
wvdschel
It's not Turing complete according to the Wikipedia page, but there are Turing complete variations of it.
David Johnstone
+4  A: 

Assembler for me.

Not the least because my primary diagnostic was a machine lockup and reboot.

Mark Harrison
+3  A: 

Somewhere between useful languages that are hard to learn (Common Lisp, Haskell, etc.) and useless languages (Whitespace et al.), there's Redcode. It's an assembly language for playing the Core War game. For an assembly language, it's fairly striped down and accessible. Warrior programs are also easy to understand if you take the time to step through the code mentally. But writing new warriors is very challenging. I can only assume that writing new warriors that are actually successful is even more challenging.

Jon Ericson
+1  A: 

I've never been able to learn Java. (But that's more of a motivation issue than anything else.)

Jon Ericson
+1  A: 

VHDL, it's a hardware description language and is really hard to grasp if you are used to normal programming, it's not the hardest but I feel that it's a more worthy contender than some of these languages that have been designed to be really hard to use ;)

Teifion
A: 

Another vote for Malbolge: the language changes as you use it based on what you do, according to a complicated trinary register system. It is a combinitorial explosion to determine what a given command will now do. Plus, the developers encourage undocumented changes to the interpreter upon redistribution, discouraging portability and making it unlearnable in practical terms.

John the Statistician
+3  A: 

Try Postscript.

pi
Sigh... I fondly remember writing PostScript code back in the late 80's. Once you get used to the stack-based paradigm, you could do a lot with it.
jalbert
+1  A: 

I think MDX and XSL are the hardest I've ever managed to grasp. They aren't procedural, and are unlike anything else, really.

Magnus Smith
If you think of XSL as in XSL/T then the mindset is very similar to Haskell combined with SQL.
Thorbjørn Ravn Andersen
A: 

I'm nominating Java2k. Here's a few features:-

  • Java2K is not a deterministic programming language, but a probabilistic one. Even for built-in functions, there is only a certain probability the function will do whatever you intend it to do.
  • Java2K uses a 11-based number system, which is a very good approximation of the 10-based decimal system for many purposes, including counting up to and including 9.
  • Java2K has a garbage collection: memory is freed when the program exits, or, at random intervals, whichever comes first.

Skizz

Skizz
A: 

Chinese probably.

Daud
Hungarian is much mpore difficult AFAIK, except the writing.
Zsolt Botykai
A: 

The hardest language to learn is the one that uses a paradigm that's most opposite from the way you think.. for instance if its easy for you to think in sets then SQL is not a hard language to pick up; if not then it will take you more time.

Giovanni Galbo
+8  A: 

Although I have used aforementioned candidates Lisp, Prolog and Assembly, I could easily nominate C++ for that position ,badly designed but powerful language. The hard part of it is that you need to learn all the tricks to develop a worthwhile program. Here is what bartosz milewski ,the author of c++ in action, states about this issue

"very smart people keep writing books with titles that read like "esoteric nooks and crannies of c++", or "more bizarre pitfalls of c++". or puzzles that start with "what's wrong with this code fragment that to all normal people looks perfectly ok?". you don't see such publications in the java or c# community. c++ is becoming a freak language that's parading its disfigurements in front of mildly disgusted but curiously fascinated audience. * in the future, people who do nyt crossword puzzles and the ones who program in c++ will be in the same category. "

there are at least 10 something similar books to learn just the core of the language-not GUI or APIs-, which is really onerous.

Comptrol
I agree - really learning C++ is a challenge.
David Grant
I remember reading an email exchange between Bjarne Stroustrup and Andrei Alexandrescu arguing about what some obscure C++ code should do. That was when I realized I will never be able to learn C++.
Dour High Arch
To paraphrase the Tao: "You perceive this immense structure and are disturbed that it has no rational design. Can you not take amusement from its endless gyrations? Do you not enjoy the untroubled ease of programming beneath its sheltering branches? Why are you bothered by its perversity?"
Jon Purdy
+2  A: 

J.

This is quicksort in J:

quicksort=: (($:@(<#[) , (=#[) , $:@(>#[)) ({~ ?@#)) ^: (1<#)
Zarkonnen
A: 

Befunge, programming in 2 dimensions

Jimmy
+3  A: 

Ignoring the intentionally difficult languages like whitespace and its ilk, I have to go with APL.

Not so much because the language is all that hard (although, if you don't have much of a math background it can be a bit of a shock) but because you can't type it on a normal keyboard.

Sure - it was done with the best of intentions (they just needed more symbols than QWERTY provides,) but still. That's crazy. What other real languages have a whole section in the wiki page devoted to keyboard layouts?

Or to put it another way: even whitespace can be documented in a web page with normal HTML.

Electrons_Ahoy
+10  A: 

The hardest language to learn is one that is in a paradigm that you haven't learnt.

Here are four examples of languages each one from a different paradigm:

Prolog (logic programming) - learning to make the computer do things by evaluating logical statements that occur as Horn clauses.

Haskell (Functional Programming) - learning to make the computer do things by evaluating functions (and functions of functions of functions).

Pascal (Imperative, Structured programming) - e.g. learning to make the computer do things by assembling ordered packages of instructions against data structures

Smalltalk (Object-oriented programming) - learning to make the computer do things by sending messages to objects, making new objects and creating and destroying associations between those objects

Every time you learn a new paradigm, it's going to be very difficult.

Learning within the same paradigm - especially when there's syntactic similarities should be pretty easy:

e.g. moving from C to non-OO perl to Pascal (all imperative), or moving from C++ to Java (all OOP)

cartoonfox
If I could +10 I would.
Joel
A: 

I think it depends on your first steps in programming. If you learned to write code in a language which are C based than it will be harder to learn not c based languages.

But I also agree with others who said that depends on how you learn it.

For me it was always horrible to read 200 or more pages to getting started with language. Everytime I need to learn a language I try to read enough to try it on my own and than the try-and-error period begins. And so on.

But I think there are really few people who knew EVERYTHING about a language.

OemerA