

Advanced programming languages - Arun2009
http://matt.might.net/articles/best-programming-languages/

======
mooism2
The author includes a perfect (if unintentional) example of why Haskell
programs _shouldn 't_ use `error`. (If you're writing a quick-and-dirty
program? Fair enough. But not in larger programs.)

He defines a `Lattice` class, and explains that if a type implements the
`Lattice` class, it supports all the operations within the `Lattice` class.

He then presents an implementation of the `Lattice` class that _doesn 't_
support all the `Lattice` operations (`top` punts to `error`). It breaks the
promise, breaks the contract, _undermines the guarantees_ the type system
gives you.

So don't use `error` in Haskell. (And for that matter, don't use other partial
functions such as `head` and `tail`.)

------
frozenport
Weather or not you code in it, C++ is a must for understanding how a program
works.

~~~
ibotty
c++? hardly. maybe c, but i'm not sold.

why not say assembler "is a must for understanding how a program works"?
because when you are talking about the underlying machine, that's what you
mean.

but if you are not speaking about the machine, but the program (algorithms
within) a higher-level language might even lead to better understanding
because you can focus on the important parts. that language does not have to
be functional (some algorithms _are_ imperative) but might be, say, python.

~~~
frozenport
Assembly is also good and I spent a semester teaching it to 2nd semester
students. I think C++ is a better choice because it exposes folks to low level
programming in a more controlled fashion.

For many people python is their first language.

~~~
ibotty
but the '++'-part does not help in understanding the machine, does it?

(i like many new-in-c++11 constructs so don't get me wrong. but they further
abstract from the machine.)

~~~
frozenport
Knowing OOP is also useful, and knowing how OOP behaves on a machine is also
useful (vtables). I can't recommend Scheme or Lisp because it will leave
students disconnected from the real-world software stack.

~~~
ibotty
well. of course knowing oop is useful. but why the modula flavor and not the
smalltalk flavor? vtables cannot be used with message-passing object
orientation.

shouldn't students learn lambda-calculus? shouldn't you teach a functional
programming language then? or even a logic programming language? "the real-
world software stack" is not the most important thing in the world.

