Should I learn LISP as a beginner programmer?

As a hobbyist, I wish I had learned a lisp first. I’d guess almost all of my troubles with C++ and Java could have been easily avoided. I know a lot of folks think C or ASM are the way to start, to “really know what’s going on under the hood” or whatever, but having actually been there as a self-taught programmer, it has actively hindered absorbing some of the most basic concepts.

Nevertheless, it is important to realize that not all hobbyist programmers have the same goals. I only occasionally consider making games, mostly I test various ideas and play with other things I am learning about, so learning how to program is more important to me than having a great library, or access to DirectX / OpenGL, etc. Someone making a quick and dirty game might want Python for PyGame, Lua for easy C/C++ embedding, Flash for quick-and-dirty graphics, etc.

I disagree. With Java one will learn most of the basics of programming and the step from imperative to functional is smaller than the reverse.

But that’s not relevant to the tradeoffs of “opportunity costs” because virtually all languages have variables, loops, branching, functions, procedures, etc (the “basics” of programming).

Well all imperative programming languages. And as an example of one, Java is a fine choice.

But one could study only functional programming languages and miss out on some of these concepts.

Neither common lisp nor scheme are functional languages.

I’m not commenting on whether Java is fine or not fine.

I’m emphasizing that learning a language does not come for free. It comes at the expense of something else.

Let’s suppose petew83 would like to have his game done in 3 months. And for his particular project, it matches up with Flash Actionscript best. In that case, petew83 can just start with ActionScript during those 3 months – Actionscript has variables, loops, and branches. Sure, he can learn java during those 3 months but doing that comes at an opportunity cost: it means his Actionscript game is not finished in 3 months because he was messing around with java. Maybe in the big scheme of things, this is fine but it still doesn’t mean java investment is free or doesn’t need to be prioritized.

I’m just reversing the common advice whenever someone asks, “should I learn language X?”
Inevitably, the answer is always, “yes, it can’t hurt to learn language X.” That’s not true. Learning languages cost time and time isn’t infinite.

Oh, I understand now and we’re in agreement – pick the language that best solves your problem.

Which is very easy to do if you already know about five or six languages. But if you only know one, it’s not even clear you understand the problem you want to solve! :wink:

Put me down in the no category. I took a course that was taught in LISP at the end of a BA in CS and I pretty much grew to hate it with a passion. I hate to see a beginner deal with it. Like somebody else pointed out LISP has parens, lots of them. (Which is why one of the jokes about it is that LISP stands for “Lots of Idiotic and Stupid Parenthesis”) What they didn’t mention is not only does it have alot of them, you have to use exactly the right amount or your program crashes. (Too many or too few and the program blows up. You wouldn’t think it’d be that much of an issue but boy did I keep running into it.)

The second thing I hated about LISP was LISP coders basically do run on sentences. Basically instead of breaking up things and using multiple lines (which made debugging easier) the examples I saw had loads of code all done in one line. (My joke about that was that the standard terminal a LISP programmer used produced a 50,000 volt shock every time the enter key was pressed so that’s why they wrote a 4 line program, each line being thousands of characters long. Yes I’m exaggerating a bit.)

I mean all you need to know is LISP has a key word called DEFUN. Yes, the creators of LISP let everybody know the point of LISP was to remove fun from coding.:slight_smile:

I had a CompSci minor in my B.A. They started us on Java, and we used that a lot, but I learned some LISP in one of my courses. IME, LISP was really great for teaching you how to program recursively, but I wouldn’t want to learn it as a first language. I may be prejudiced, but I think Java is a good one to start with.

As renigade from the teaching side of CS, this is a very familiar question. Whenever we used to talk about the choice of teaching language, Scheme would always come up. Eventually it became a running joke - we all understood the serious advantages that came with teaching Scheme, and all understood that the market forces that surround any university teaching meant it would not be viable. They taught it at MIT as the introductory language. They are not fools. But in a time limited curriculum where many students would not major in the subject but merely wanted a simple grounding to enable them to go on and be engineers and scientists, it wouldn’t fly.

But, have a look at Structure and Interpretation of Computer Programs by Abelson, Sussman here: http://mitpress.mit.edu/sicp/ The entire text is on-line under creative commons. This is widely considered to be one of the best, and one of the most influential books on teaching computer programming.

Scheme was designed from the outset as a teaching language. However since t recursion is the fundamental paradigm many people who have initially been taught itterative modes of thinking find it a bit duanting. For the first couple of pages. If you consider yourself a programmer and have trouble with recursive algothims, you are not a programmer.

There is a massive difference between a language that allows fast progress in learning ideas and paradigms, and a language that is suited to modern application at the coal face. This mostly comes down to the availability of large well sorted application libraries. However the very presense of these libraries is a serious impediment to learning. People find themselves learning (or worse, being taught) little more than a massive list of libraries to do useful things - and never learn how things actually work. Then the library changes (or the applcation environment changes under them) and everything they learnt is worthless. Learning the fundamentals is key. That knowledge will take you through any paradigm shift in computing.

Personally for everyday programming, I use Python. Python is nice and easy to get code working in fast, and has a massive library support - so real useful tasks can be done quickly. But I would not suggest learning Python early. It isn’t the right language to learn concepts - and with Guido’s slightly idiosyncratic and absolutist take on the language - things can change in ways that are hard to fathom unless you have those fundamentals.

I don’t believe anyone understands what the approriate paradigms needed to take computing to a massive multi-core future will be. Most certainly not Microsoft. MS have a habit of creating a list of emminent computer scienbtists and making them an offer they can’t refuse to work in the research labs. Pretty much no MS product ever comes out of the labs. It seems more a vanity thing for MS. (I used to do high perfomance programming on many hundred core machines for a living. It is harder than most people think, and the problems are not what most people think they are.)

One thing for certain however. Not understanding the fundamentals will consign you to a future where you never make the jump to multicore.

F# was a research project led by Don Syme that’s now shipped with Visual Studio. Similarly, TrueSkill (written in F#) was another MS Research project that’s used by millions of people on the XBox 360.

Most functional languages offer no advantages over imperative languages for multicore programming. Only pure functional languages like Erlang or Haskell offer that benefit. Bolting on functional language features onto a language like C# certainly doesn’t do anything to help your program use multiple cores.

C# got functional language features because many people find that they offer a convenient way of expressing solutions to some common programming problems.

I was talking about languages like Haskell. The final sentence was meant to imply that mainstream programmers are being moved toward functional languages on the sly.

Thanks everyone for the answers. I’ll have to spend some time and take a look at some of the different choices mentioned. At least now I have some direction.

Did you hear that there is an object oriented COBOL? It’s called “Add 1 to COBOL”.

The first sentence is completely true. But I don’t understand the second. Pure functions are easy to parallelize, so functional languages, or at least their pure subset, will most certainly be the target of parallelization optimization in their compilers (like Haskell already is), but purity of the language overall has really nothing to do with it, and Erlang is not a pure functional language, either.

Those who do not use lisp are condemned to Greenspun it.

I just stumbled upon a blog posting (from 2006) that echoes the above sentiment. Quoting from the end:

But for slightly different reasons :wink:

Reading this post reminds me of why I got out of programming. No matter which language you pick, it’ll be out of fashion in 5 years.