Linked by Thom Holwerda on Fri 16th May 2014 17:02 UTC
General Development

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.

Order by: Score:
Finally...
by Kochise on Fri 16th May 2014 17:27 UTC
Kochise
Member since:
2006-03-03

Lisp -> Common Lisp -> Scheme -> DrScheme -> Racket

At least an article dealing with probably the most outrageously powerful programming language mankind ever dared to invent.

www.joelonsoftware.com/items/2006/08/01.html
www.paulgraham.com/lisp.html
www.paulgraham.com/onlisp.html

Kochise

Reply Score: 5

RE: Finally...
by moondevil on Fri 16th May 2014 17:40 UTC in reply to "Finally..."
moondevil Member since:
2005-07-08

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.

Reply Score: 6

RE[2]: Finally...
by Kochise on Sat 17th May 2014 16:53 UTC in reply to "RE: Finally..."
Kochise Member since:
2006-03-03
RE: Finally...
by some1 on Fri 16th May 2014 18:52 UTC in reply to "Finally..."
some1 Member since:
2010-10-05

Scheme is not in any way a successor of Common Lisp. It's closer to the opposite.

Reply Score: 4

RE[2]: Finally...
by Kochise on Fri 16th May 2014 19:29 UTC in reply to "RE: Finally..."
Kochise Member since:
2006-03-03

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

Reply Score: 2

RE[3]: Finally...
by Kochise on Fri 16th May 2014 22:36 UTC in reply to "RE[2]: Finally..."
Kochise Member since:
2006-03-03

Lisp in Python :

http://norvig.com/lispy.html

Kochise

Reply Score: 2

Abusing Language Features
by fretinator on Fri 16th May 2014 22:21 UTC
fretinator
Member since:
2005-07-06

AKA, every damn program I've had to maintain in the last 15 years!

Reply Score: 6

RE: Abusing Language Features
by bosco_bearbank on Fri 16th May 2014 23:34 UTC in reply to "Abusing Language Features"
bosco_bearbank Member since:
2005-10-12

I've been abusing various programming languages for almost 40 years - and I don't intend to stop now.

Reply Score: 4

RE[2]: Abusing Language Features
by Jondice on Sat 17th May 2014 01:36 UTC in reply to "RE: Abusing Language Features"
Jondice Member since:
2006-09-20

you rogue

Reply Score: 2

Shane
Member since:
2005-07-06

While we're on the subject of functional programming, a new language that I'm currently excited about is Elixir.

From the Elixir website:

Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language that focuses on tooling to leverage Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades.


I've been thinking about distributed systems lately and was looking into Erlang. Elixir is the next language that I'll be learning.

Reply Score: 5

Kochise Member since:
2006-03-03

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

Reply Score: 2

Template metaprogramming
by kwan_e on Sat 17th May 2014 23:00 UTC
kwan_e
Member since:
2007-02-18

Actually, learning a bit of LISP helped me finally understand C++ template metaprogramming, but more importantly how to do metaprogramming neatly.

Reply Score: 3

Kinda old-school thinking.
by deathshadow on Sat 17th May 2014 23:21 UTC
deathshadow
Member since:
2005-07-12

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

Reply Score: 2

RE: Kinda old-school thinking.
by righard on Sun 18th May 2014 11:19 UTC in reply to "Kinda old-school thinking."
righard Member since:
2007-12-26

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!


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 ;)

... 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.


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.

Reply Score: 3

RE: Kinda old-school thinking.
by kwan_e on Tue 20th May 2014 04:29 UTC in reply to "Kinda old-school thinking."
kwan_e Member since:
2007-02-18

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.


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.

Reply Score: 2

How about Dylan?
by BlueofRainbow on Tue 20th May 2014 03:45 UTC
BlueofRainbow
Member since:
2009-01-06

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.

Reply Score: 2