8 ms·
Common Lisp is the best language to learn programming
- chimeracoder 15y agoI definitely agree, with a caveat: I would say that (Common) Lisp is the best language to learn computer science. If I had only an hour to teach a young child some fundamental CS concepts, I would make sure to include the concept of recursion. Common Lisp makes this, as well as a few other CS 'building blocks', trivially easy. (The reason I'm distinguishing between programming and CS here is that 'programming' is a broad term that encompasses a number of use cases. If someone wants to learn 'programming' to throw together a few simple webapps or do some text processing, Lisp will get the job done, but they probably won't care too much about learning these fundamentals).
- Volpe 15y agoYep, just like the best way to learn carpentry is "Hammer". Languages are tools, people learn differently, there is no best way. If there was though, it'd be Ruby. ;)
- nkassis 15y agoThere definitively better ways then others. Having seen full classes of people learning C++ as a their intro to programming I can say there definitively bad ways to teach programming (My wife was one such student, it really turn her off to the whole experience and I'm trying my best to get her to try it again with something better) Ruby is a very good choice for sure. Between the two(CL or Ruby) I don't know which one I'd pick. I guess ruby has a little more practical aspects to it. Lisp has some advanced features that could be used for more advanced students.
- chimeracoder 15y ago> If there was though, it'd be Ruby. ;) I know you're being tongue-in-cheek with that, but I think there are three distinct use cases for learning to program. For people who want to learn CS from a ground-up, theoretical foundation, Lisp is a nice choice. It is very easy to teach functional programming while simultaneously teaching the fundamentals of theoretical computer science, so you get the best of both. For people who want a bit more 'traditional' approach, and also want to learn about computer science from a low-level perspective, C is a good choice. It teaches memory management and gives an insight into computer hardware & systems that higher-level scripting languages don't. (This latter part is where Java fails - how can you appreciate references and garbage collection until you've mucked around with pointers and malloc() in C?) For people who just want to dabble in programming, or for people without a mathematical background, or for people who just want to prototype small projects quickly... then yes, scripting languages like Ruby (or Python) would be the 'best' way. As you said, languages are like tools, but I think these three categories of tools cover the majority of use-cases nowadays for the beginning programmer.
- dagw 15y agoI'd add a fourth use case (which is somewhat similar to case three). People who don't want to be "programmers", but just want to learn how to simplify and optimize the normal day to day tasks they do. In that case I'd recommend whatever scripting language is standard in whatever app they use. For example I know people who probably would never claim to be programmers and never had any desire to learn programming for programming's sake, but have still taught themselves to do pretty advanced stuff in VBA, AutoCAD Lisp or MEL (Maya's scripting language) because they saw how much easier it made their work.
- anghyflawn 15y agoWell, I suppose I fall into this category: I'm a grad student in the humanities, with a fair bit of math background which I don't actively use in my work (apart from some simple statistics), and I mostly program to automate away things that take too much time otherwise. I was taught Pascal in college, but in a "monkey see monkey do" way (for instance, we did implement linked lists, but nobody really explained pointers to us, it was just "put a star there and it'll work"); later I picked up Python and also did a Django project. However, via a friend I discovered Common Lisp and I have never looked back; I just find it comes very naturally to me. Still, I agree that something like Python is a very suitable language for somebody who just needs to simplify their lives. (At my old school they've switched from Pascal to C# now... why?)
- sedachv 15y agoRMS has an interesting anecdote about this in his speech on Emacs: "[Bernie Greenberg] wrote a version of Emacs in Multics MacLisp, and he wrote his commands in MacLisp in a straightforward fashion. The editor itself was written entirely in Lisp. Multics Emacs proved to be a great success — programming new editing commands was so convenient that even the secretaries in his office started learning how to use it. They used a manual someone had written which showed how to extend Emacs, but didn't say it was a programming. So the secretaries, who believed they couldn't do programming, weren't scared off. They read the manual, discovered they could do useful things and they learned to program." http://www.gnu.org/gnu/rms-lisp.html http://www.gnu.org/gnu/rms-lisp.html
- antimora 15y agoI think it's Python not Lisp. This is my opinion.
- nkassis 15y agoI do think the article make a good point, CL is hard to outgrow. You can learn almost any type of programming out there in CL. Python doesn't have that level of flexibility as far as programming paradigms as CL in my opinion.
- gbog 15y agoI can't read the FA right now but a strong +1 for Python is the student can use it on any machine for any purpose, and tweak existing softwares.
- whateverer 15y agoOh yeah? Well, by learning Ruby you get all that and you become a Rockstar. Kids love being rockstars. So there. Edit: To the downvoters (and feel free to keep downvoting, if that rocks your boat): the "+1 for Python, because" comments were as empty as this one, and less warranted at that. Ultimately where you start isn't as important as where you go. It's just a matter of picking a language, any language, some books, and shutting your ears down to everyone telling you that it doesn't get any better than that.
- guard-of-terra 15y agoYou don't want to limit yourself to one language, and it seems that for every task there's a better language (than CL).
- technomancy 15y ago> CL is hard to outgrow. This seems to imply there's some kind of benefit to only learning a single language, which I don't understand at all.
- stevelosh 15y ago+1 for Python. I adore Clojure (and Common Lisp to a lesser extent), but getting a new person excited about programming is far easier when they can do something useful really quickly. Python's massive collection of libraries makes that easy.
- spooneybarger 15y agoAfter learning a large number of programming languages, if I was going to start someone fresh with learning to program, I would pick either a scheme ( in particular racket ) or a smalltalk. Scheme is a little bit on the 'toolkit-y' side and slightly less accessible than smalltalk for someone just starting out but, both have what I consider most important: a minimum of rules and syntax. anyone learning to programming in either would be primarily focused on how to solve the problem in front of them rather than solving the language. This all said, I haven't tried this out in any scientific fashion so it is mostly just intuition.
- tsotha 15y agoThat's not what I would teach first. I'd start with a simple assembly language, like 8080A. After that C, and then lisp. The problem with starting students on lisp is they have a hard time grasping what's going on under the hood.
- danso 15y agoEr...depends on why the students want to program, right? I studied assembly and I may be taking for granted the computer science foundations that it gave me, but it has almost no bearing in what I do in my current day programming. And I had learned C, C++ and Basic before my assembly classes. Teaching students assembly as their very first language seems akin to teaching students Latin before they can learn French, German, Spanish, etc. Sure, it's helpful and...IF they get pass that first dry session.
- rbanffy 15y agoAn simpke, elegant 8-bit microprocessor is very simple to hold in one's brain. That said, the 8080 and its offspring would never be my choice. I'd suggest the 6502, the 6809 or the 32032 (which is not 8-bit, but very easy to understand)
- twstws 15y agoThere's a big difference between 'simple to hold in your brain' and 'simple to do something useful with'. For someone just starting out programming, the second is arguably much more important. The article mentions Land of Lisp presenting a simple web server in 15 pages of text. What would you be able to explain in 15 pages of text for assembly?
- RodgerTheGreat 15y agoWell, JonesForth manages to explain a self-hosting Forth compiler/interpreter (as well as the language itself) in about 30 pages of assembly, including extensive references and ASCII-art diagrams: http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jonesforth.S;hb=66c56998125f3ac265a3a1df9821fd52cfeee8cc http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jone... Seems like that should qualify as comparable.
- Fixnum 15y agoI think Scheme comes the closest to being an ideal teaching language. It has all the same advantages adduced (great books, simplicity, power) in even greater measure. For instance, there's no 'funcall, 'apply, and sharp-quoting everywhere, and no powerful but baroque object and package systems deeply integrated into the language. Scheme macros are a bit complicated (especially implementation-wise) but can be sugared over (e.g. define-syntax-rule or CL-like syntax for basic macros) and at least they're "correct". Scheme isn't perfect, of course, and I'd love to see a modern Scheme-like Lisp with a canonical implementation and borrowing freely from Haskell, Erlang, and friends while preserving its minimalist ethos (somehow neither Racket nor Clojure is this). Of course, the readiness is all ... while there's a beauty in simplicity, can a novice without any higher mathematics really appreciate the style of programming one does in Scheme?
- spooneybarger 15y agoI've tried introducing one person w/ higher mathematics knowledge to scheme and it went well. I think that people think that imperative programming is somehow 'more natural'. I still sort of think that but, I haven't seen that bourne out when I try teaching programming. All programming is foreign to people when they start. And you are influenced by what you start with. I started with Forth ( ages ago ) and when I first started using an imperative language, it was a struggle for me.
- rayiner 15y agoI think imperative programming is more foreign for someone who doesn't know programming. Defining a program using equational reasoning is more natural to someone who knows basic math.
- snprbob86 15y agoCuriosity, not argument: Why don't you think Clojure meets those criteria? - Canonical implementation on the JVM - Borrows modern functional programming concepts from Haskell (type classes -> protocols, immutability, etc) - Robust concurrency constructs. While not directly copied from Erlang, designed with clear understanding-of and respect-for Erlang's successes and failures. - Minimalist standard library The only thing I can think of that isn't minimalist would be the reader-macros for vectors, maps, sets, lambdas, etc. However, it seems like those serve to reduce confusion & strike a decent balance between uniformity of syntax and clarify of meaning.
- _mrc 15y agoDepending on the goals of the learner, something with immediate visual feedback is nice. Logo/turtle graphics or Smalltalk would be good for this. While you're not going to write my-first-blog in Logo, it's something my 5 year old can get her head around. And it's the thin edge of the lisp wedge :)
- eropple 15y agoWhile you're not going to write my-first-blog in Logo Sounds like it needs more extensions.
- sedachv 15y agoAgreed. Warren Wilkinson had an idea for a simple Lisp wrapper to SDL for this purpose (http://formlis.wordpress.com/2011/01/22/teaching-children-programming/ http://formlis.wordpress.com/2011/01/22/teaching-children-pr...). But it needs to be something even simpler, "Logo easy." HTML5 Canvas is actually a good system for this IMO.
- thedufer 15y agoThis feels like something that someone completely removed from people who don't know how to program would say. I can't imagine the horrors I would've gone through if I couldn't fall back on the fact that my first language (C++) basically looked like the mathematical notation I was used to (infix binary operands, prefix functions). Until the standard is to write math in prefix (I'm definitely not condoning this), Lisp is not the right language to start with. This remains the biggest problem with places like HN. When everyone has a similar background, they can agree on conclusions that the rest of the world would find ludicrous.
- luckydude 15y agoAs far as I know, the hacker news site is written in some lisp, with lots of lisp fans here. I'm with you though. Lisp can be great for some problems but it's mostly not. The lisp guys hate hearing that and shout you down. One measure of a language is how well it works to pass on a source base to a new team of programmers. I bet if someone were to go measure lisp against C they would find at least a 100x greater success rate with the passing on of C. The lisp guys are profoundly focussed on how easy it is for them to write code. The real world is more concerned with how easy it is to maintain, review, enhance code.
- eeperson 15y agoThis seems like a strange accusation. It seems like the usual complaint is that lisp programmers are more concerned with elegance than getting anything accomplished. I think this provides an interesting counterpoint: http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy
- tsotha 15y agoHeh. As much as I agree with pretty much everything he says in that presentation the GP's point is pretty relevant here: Rich Hickey is far, far to the right on the programming bell curve. Things normal people will have real difficulty grasping are going to seem glaringly obvious to someone like that.
- GeneralMaximus 15y agoAs I've said elsewhere, your choice of language must be driven by what libraries you want to use. I read Land of Lisp earlier this year and went through the Racket guide a few months ago. Currently I'm rewriting my blog using Seaside on Pharo Smalltalk. The one thing that keeps coming back to bite me in the ass is that there are few libraries available for any of these languages. When libraries are available, they're poorly documented. Of course, this is becoming less of an issue in Common Lisp thanks to QuickLisp. There's a Racket book coming out next year, which might help with adoption and result in better libraries. Still, it will take years before any of these languages catch up to Python/Ruby/Java. Edit: I thoroughly enjoyed learning and playing with all three languages. Smalltalk, in particular, felt very natural. It has the eerie property of seeming like an extension of your brain.
- daniel-cussen 15y agoThe first language I learned was clisp and it was the only one I used for the first two years. It was awesome. It was a long learning curve, and I couldn't do almost anything for a really long time, but I got to a point where I knew everything about this tiny universe and had a solid foundation to branch out from. With that I went on to learning java, python, js, and c, and became fascinated at how much faster things became as I used more state and therefore got closer to the hardware. For a while I was a little worried that I would only be able to use functional programming and would not be able to learn how to use state, but that was not the case.