The hardest thing about learning a new programming language is that there are usually at least one or two novel features that break the mold of our current mental framework. If not, the language may not be worth learning in the first place.
So, given that learning new languages can be challenging, I would like to share a tip that has served me well over the years.
One of the best ways to really understand a new or novel language feature is to think of ways to twist and abuse it.
Lisp -> Common Lisp -> Scheme -> DrScheme -> Racket
At least an article dealing with probably the most outrageously powerful programming language mankind ever dared to invent.
http://www.joelonsoftware.com/items/2006/08/01.html
http://www.paulgraham.com/lisp.html
http://www.paulgraham.com/onlisp.html
Kochise
How would the programming world look like nowadays, if Symbolics hadn’t failed in the industry at large.
There is even a research paper about its downfall.
You should also have mentioned Clojure, although not a pure Lisp, it has a lot going for it in the industry.
Rise and downfall :
http://www.flownet.com/gat/jpl-lisp.html
http://www.youtube.com/watch?v=_gZK0tW8EhQ
Kochise
Scheme is not in any way a successor of Common Lisp. It’s closer to the opposite.
True indeed :
http://www.levenez.com/lang/
Lisp 1958 -> Scheme 1975 (merged with Algol) -> Common Lisp 1984 -> Clos 1989
Another source :
http://oreilly.com/pub/a/oreilly/news/languageposter_0504.html
Kochise
Lisp in Python :
http://norvig.com/lispy.html
Kochise
AKA, every damn program I’ve had to maintain in the last 15 years!
I’ve been abusing various programming languages for almost 40 years – and I don’t intend to stop now.
you rogue
While we’re on the subject of functional programming, a new language that I’m currently excited about is Elixir.
From the Elixir website:
I’ve been thinking about distributed systems lately and was looking into Erlang. Elixir is the next language that I’ll be learning.
Good choice. Learn core Erlang/OTP also, even though the IDE sucks (yeah, don’t like eMacs, Eclipse is slow, IntelliJ, …)
In my mind, there is ONLY 4 languages really necessary to learn thoroughly : assembler (of course), C (not C++), Erlang and… Lisp, the highest level of all of them. With these, you cover all needed levels.
Kochise
Actually, learning a bit of LISP helped me finally understand C++ template metaprogramming, but more importantly how to do metaprogramming neatly.
In many ways this feels to me like artificially recreating the environment and attitude programmers had to have in the early days of Microcomputing. Back then you had to find innovative ways of doing things, often using operations and language constructs (right down to the machine language level) to fit your code in the limited amount of RAM, to make it execute sometime this century, and in general just plain work.
Back when we had single digit K of RAM (or less), clock speeds could still be measured in 4 digits or less in KHZ, using operations for things the hardware designers never planned on was just how you did things… a far cry from the K-LoC re-re’s on the ‘big iron’ of the time.
It’s part of why I still go back and write software for old computers, it keeps me ‘sharp’ and in the right mindset.
“language bending” (what we used to call it, much akin to “circuit bending”) is a great way to get right into a language, and to make sure you KEEP LEARNING… no matter what language you are using, there’s ALWAYS something more to learn; the day you stop learning is the day the rest of the world leaves you behind.
Though I do have a lot of mental blocks on certain types of programming I just can’t get past — and even methods/exercises like this can’t get me past them. I started out hand assembling RCA 1802 machine language, and can easily deal with Pascal, C, C++, JS, PHP, Cobol, DiBol, Fortran, C#, JAVA… but I can’t even grasp how visual programming is supposed to work, much less the noodle-doodle nonsense of languages like Ruby, Python, Haskell, LISP… They make about as much sense to me as Prolog; which is to say none whatsoever!
… and I should like Python — I’m STRICT as HELL about my code formatting habits; it’s just the rest of the language I don’t like. To the point I can’t figure out how anyone could call that mess “easy” or, as the Raspberry Pi fans seem to think “good for beginners”. It makes C look good!.. and I hate how needlessly and pointlessly cryptic C is – but at heart I’m a Wirth kind of guy.
Different strokes I guess.
Edited 2014-05-17 23:23 UTC
One day I watched a Common Lisp demo, coming from C and C++ it blew my mind. It looked so elegant and brilliant that I had to learn it. It took quite some effort for me though because nothing felt natural. After a while I understood most of the theory but it seemed, though elegant, too academic and roundabout. But at one point, I think after about a year, everything suddenly “clicked”. It didn’t even happen whilst programming. My brain adjusted to this different way of programming and everything made sense.
The good part is that procedural languages still make sense to me as well.
I tried to learn Haskell and though I envy some of its features it seemed not practical enough for my uses. It looks like it is a brilliant language if you’re just doing mathematics. Probably I’m wrong though.
As for Prolog,.. Prolog is just weird, I’ll learn it next
I think Python is said to be easy because it is quite easy to get started with it without learning all that much. I gave a game programming course using Python for non-programmers. After just one lesson of Python people could produce small little games with it. The code was a buggy, laughable maintenance nightmare, but it worked!
This wouldn’t work with C, without knowing some basics they wouldn’t get it to compile, and if they did, it probably just crash.
The difficulty of C does scale much better though. If you the basics everything is very logical. Not so with Python.
I think your issue can be summed up very simply: you’re not wired for declarative programming.
I myself had trouble switching from an imperative mindset to a declarative mindset but once it clicks, it’s easier in a lot of respects. Actually Python was that language for me. Its list comprehensions were what introduced me to a declarative style rather than an imperative style.
I now mostly write C++ and Java in a declarative style, or rather design things to be easily and efficiently written in declarative styles in those languages. Things are a lot cleaner when you don’t have to write as many loops* or nest* as many if-then-elses.
* Thinking about it, a good way to transition from imperative to declarative styles of programming is to do event-based (or dispatch) programming.
Dylan evolved from a foundation of Scheme. And like Scheme (and LISP), it has a set of primitives upon which the rest is built-on – making it very easy to create a dialect!
In the early days (pre-DRM (Dylan Reference Manual)), there were quite a few Dylan interpreters with some written in C (Marlais, Mindy) and some in Scheme (iDyl, Thomas). There was even a LISP to Dylan “translator” (see here http://norvig.com/ltd/doc/ltd.html ).
Unfortunately, in its official language description defined in the DRM, Dylan dropped the prefix syntax and all the parentheses to take an infix syntax more akin to Pascal. It was also soon after orphaned by its creator (Apple). These two events more or less condemned Dylan to a very very slow growth in popularity.
To this day, Dylan appears to be a ill-liked hybrid just waiting to be “abused” and improve in the process.