Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schliemann's method of programming language learning

Background: 19th-century German archeologist Heinrich Schliemann was of course famous for his successful quest to find and excavate the city of Troy (an actual archeological site for the Troy of Homer's Iliad).

However, he is just as famous for being an astonishing learner of languages - within the space of two years, he taught himself fluent Dutch, English, French, Spanish, Italian and Portuguese, and later went on to learn seven more, including both modern and ancient Greek.

One of the methods he famously used was comparison of a known text, e.g. take a book in a language one is fluent in, take a good translation of a book in a language you wish to learn, and go over them in parallel. (various sources cited the book used by Schliemann to be the Bible, or, as the link above states, a novel).

Now, for the actual question.

Has anyone used (or heard of) an equivalent of Schliemann's method for learning a new programming language? E.g. instead of basing the leaning on references and tutorials, take a somewhat comprehensive set of programs known to have high-quality code in both languages implementing similar/identical algorithms and learn by comparing them?

I'm curious about either personal experiences of applying such an approach, or references to something published, or existance of codebases which could be used for such an approach?

What got me thinking about the idea was Project Euler and some code snippets I saw on SO, in C++, Perl and Lisp.

like image 439
DVK Avatar asked Feb 17 '10 17:02

DVK


2 Answers

I would expect Schliemann's method to work very poorly, because one of the points of creating a new programming language is to introduce new objects of discourse and new means of transferring control. In Schliemann's method of comparing two texts, the objects of discourse are always the same, only the language used to talk about them is different.

  • For example, method dispatch and inheritance are inherently new things. So maybe if you know Simula-67 you can learn Java, and maybe even you can stretch to learn Smalltalk or C++. But you can't possibly learn Tcl or Scheme or ML or Diesel because single inheritance and dynamic dispatch just aren't there.

  • Similarly, if you've only ever seen C or C++, or maybe even Pascal/Ada/Modula/Clu, nothing can really prepare you for the power and expressiveness of first-class functions.

  • As another example, how you can you compare solutions to string-processing problems if one language (Perl) has regular expressions, a second (SNOBOL) has pattern matching, and a third (Icon) has string scanning? Your poor head will explode!

Schliemann's method may have its uses if the languages in question are very similar. Say you know Java and you want to learn C#, or vice versa. Or change between languages in the OCaml/F#/SML family. But in most cases I suspect Schliemann's method will do you more harm than good.

like image 171
Norman Ramsey Avatar answered Oct 02 '22 19:10

Norman Ramsey


Rosetta Code may be useful. To quote the site:-

Rosetta Code is a programming chrestomathy site. The idea is to present solutions to the same task in as many different languages as possible, to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another. Rosetta Code currently has 372 tasks, and covers 197 languages, though we do not (and cannot) have solutions to every task in every language.

like image 44
Martin Avatar answered Oct 02 '22 18:10

Martin