[Haskell-cafe] off-topic question: how well do you think linguistic relativity applies to PLs and programming?

Richard A. O'Keefe ok at cs.otago.ac.nz
Thu Jan 23 02:52:54 UTC 2014

On 23/01/2014, at 1:36 PM, KC wrote:

> I would say it is more the concepts one uses than the programming language that has an effect on the programmer.
> After learning one OOP language it is not that hard to pick up another OOP language

It's not clear to me that that's true.
Consider: my first OO language was Smalltalk.
 - everything is an object
 - there is no pointer arithmetic
 - bounds checking is obligatory
 - integers are bounded
 - single inheritance
 - no static types
 - anonymous functions used *extensively* and nest
 - classes are objects 
 - you can define a variable in a class that belongs to the *class*
   (not its instances) but such that its subclasses (not their instances)
   have their own copy; inherited methods work on the receiver's copy
My third OO language was C++
 - numbers are not objects
 - there is pointer arithmetic
 - bounds checking was not available
 - integers have machine-dependent bounds
 - multiple inheritance
 - statically typed
 - no anonymous functions and no function nesting
 - classes were not objects
 - class instance variables are not available
At least half the design patterns in the Gang Of Four book either
make no sense for or are trivial in Smalltalk.

What C++ programmer would ever think of passing a class as a
parameter to a function so it could create instances of different
classes?  What C++ programmer, finding _that_ couldn't be done,
would next try to pass an object-creating function?  Answer:
a Smalltalk or Lisp programmer writing C++.

What Smalltalk programmer, faced with let's say a parsing
problem, would ever say "I'll define a combinator for that"?
Answer: one who knows Haskell and is about to switch back to it.

What I see here is that a programming language has *many* aspects
and exposure to native style in several of them definitely
enlarges what you find easy to _think_ of, whereas the one you
are using right now affects what is _easy to express_ once thought

One thing we're seeing is a lot of convergence: current Fortran is
an OO language with modules _and_ good array-crunching support,
there are C, C++, and Objective C compilers that support anonymous
functions (and Java, we keep being told, will get them Real Soon Now),
LINQ in C# was inspired by functional programming, ...

Right now, there are just three surviving languages where I trust
myself to do concurrent programming without stupid blunders that
take ages to fix: Ada, Erlang, and Haskell.  We still need *new*

More information about the Haskell-Cafe mailing list