Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Books Book Reviews

Land of Lisp 330

vsedach writes "Remember the 1980s and BASIC, when programming was simple, brains flew through space, and everyone ate lasers? Computer magazines came with code listings, and classics like David Ahl's BASIC Computer Games offered a fun and easy way to get started in computer programming. Conrad Barski remembers, and with Land of Lisp, he's set out to demystify programming in the 21st century." Keep reading for the rest of Vladimir's review.
Land of Lisp: Learn to Program in Lisp, One Game at a Time!
author Conrad Barski, M.D.
pages 504
publisher No Starch Press
rating 10
reviewer Vladimir Sedach
ISBN 978-1-59327-281-4
summary Learn to Program in Lisp, One Game at a Time!
This is no small feat. Modern computers don't come with anything that looks like BASIC. Getting started with a "real" programming language like Java requires installing and learning hundreds of megabytes worth of compiler and integrated development environment. Barski's thesis is that Lisp is a refreshing alternative - it offers BASIC's ease of getting started (get a prompt, type in code, and it works), while providing a combination of modern features unmatched in other programming languages.

The first thing that immediately jumps out about Land of Lisp is that it has a lot of comics. The book is an outgrowth of Conrad's Casting SPELs in Lisp illustrated online tutorial, which originally appeared in 2004 (incidentally, around the same time as why's (poignant) guide to ruby, probably the most famous and epic programming language comic book). The comics are humorous and irreverent - if you're a C programmer, you might be surprised to know that you're a Cro-Magnon fighting the COBOL dinosaur.

Despite the silly humor and Barski's approach of introducing programming completely from scratch, Land of Lisp builds up to cover topics like graph theory, search algorithms, functional and network programming, and domain-specific languages. All throughout, the book emphasizes various techniques for doing I/O. The topics covered will leave the reader with a solid understanding of what modern programming entails and a good basis from which to explore either application or lower-level systems programming.

The most unintentionally impressive aspect of Land of Lisp is that it manages to completely explain web programming. No more hiding behind complicated software stacks and impenetrable web server packages - chapter 13, titled "Let's Create a Web Server!," does exactly what it promises, in only 15 pages. Later chapters introduce HTML and SVG to build a graphical game as a web application. If nothing else, this book will leave the reader with all the necessary basic skills and total confidence in their understanding to build real-world web applications.

Other introductory programming books use Lisp, but none fall into the same category as Land of Lisp. Abelson, Sussman and Sussman's Structure and Interpretation of Computer Programs, arguably the greatest introductory programming book ever written, requires a solid math background to understand the examples. Felleisen et alia's How to Design Programs offers a much deeper introduction to programming than Land of Lisp, but is an academic textbook, and hence lacks funny cartoons and may be boring. Friedman et alia's The Little Schemer is a favorite of many, but doesn't have LoL's real-world applications.

Land of Lisp is an excellent book for someone who wants to learn how to program, for web programmers who want to move up out of their niche and start learning about CS theory and systems programming, and for anyone who is puzzled about what really goes on behind the web and wants to learn what web programming is really about. Experienced programmers who want to jump into using Lisp are probably better off with Peter Seibel's Practical Common Lisp, though.

Watch Conrad's hilarious promotional music video for the book.

You can purchase Land of Lisp: Learn to Program in Lisp, One Game at a Time! from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

*

This discussion has been archived. No new comments can be posted.

Land of Lisp

Comments Filter:
  • by Junta ( 36770 ) on Wednesday November 03, 2010 @03:44PM (#34116038)

    To get the most out of LISP, you really have to approach it with a mindset particularly distinct from most programming. It also happens to be distinct in nearly requiring recursion that is generally not part of an 'easy' getting started with programming. That and most people will club themselves over the head trying to sort out how many close parentheses are needed when they write something *particularly* 'clever'.

    If in modern Windows, Powershell is a good starting point, if in Linux, Python. Unlike LISP, both yield immediately marketable skills and are easy to start toying with basics and do not require a lot of knowledge of where to go to get it running, it already exists on your platform (almost certainly).

    I do agree that 'web frameworks' have mutated the relatively straightforward nature of underlying http into a frightening looking mystery to the uninitiated, but at least some in the industry are swinging back to the basics and discarding some of the oddly complex schemes over HTTP.

  • by SuperKendall ( 25149 ) on Wednesday November 03, 2010 @03:52PM (#34116150)

    Because when every programmer is a god, all ends in strife and horror and mutation.

    See: Greek Pantheon. Or Bioshock.

    Mind you, I love Lisp. But I wouldn't if I were working with anyone else on the same code for any length of time.

  • by fusiongyro ( 55524 ) <faxfreemosquito@@@yahoo...com> on Wednesday November 03, 2010 @04:00PM (#34116248) Homepage

    AppleScript is much easier to understand than to write. Nearly everyone winds up using it in an autotools-like way, looking for examples online and adapting them, with a lot of superstitious behavior. It's extremely hard to write non-trivial AppleScript, and I'm speaking as a professional programmer with command of plenty of languages.

  • by fusiongyro ( 55524 ) <faxfreemosquito@@@yahoo...com> on Wednesday November 03, 2010 @04:03PM (#34116280) Homepage

    Your information about Lisp is about 30 years out of date. It's not an acronym, Common Lisp has many looping constructs that are much more widely used than recursion, and closing parenthesis is as trivial to any modern editor or IDE as managing any other aspect of syntax. I think if you look at the cover of this book, it should be obvious to you that the target audience is not particularly interested in the marketability of their skills.

  • by jandrese ( 485 ) <kensama@vt.edu> on Wednesday November 03, 2010 @04:07PM (#34116342) Homepage Journal
    No, I don't really know of lots of copy and paste style redundant code in my C or C++ applications. Generally functions take care of that. If a problem comes up enough, said function is stripped out and added to a library. These are not new or novel concepts, people have been doing them for decades now.

    Sometimes people will add lots of copy and paste code to a codebase. We call these people bad programmers, and they tend to be fired.
  • by SuperKendall ( 25149 ) on Wednesday November 03, 2010 @04:13PM (#34116402)

    The great thing about learning Lisp as a first language is the lack of marketability, because it's to about setting you up on a path, it's about giving you fundamentals.

    As noted there is enough syntactic sugar now to not cause the kinds of rough work that used to be around, and I think the brevity of the language can be good for people in that there's not a ton of syntax to learn to actually get something real built.

    Once you have programmed in at least two languages, you have a much better idea of what you are doing I think. So given that you'll learn some "practical" language to do something, let Lisp be that "other language".

  • by Urkki ( 668283 ) on Wednesday November 03, 2010 @04:19PM (#34116482)

    What Lisp promised then is what Python promises now. With one difference, in that Python respects the visual limitations of humans.

    Different from parentheses, it's very easy to undo a bunch of indentations, just put the left margin where you want it.

    Well, if only the TAB character had never been invented... TAB is a kludge to make a typewriter behave sort of like a spreadsheet but, unfortunately, it fucks up the excellent "Don't mix content with presentation" principle.

    Saying "Don't mix content with presentation" is pretty rich from a Python advocate, when Python does precisely that. It mixes presentation (what code looks like) with content (what code does).

    Besides, don't you know that in Lisp, parentheses are indentation symbols? They tell how the code should be indented, and changing indentation is just a matter of changing parentheses. If anything, adjusting indentation of Lisp code is easier than adjusting indentation of Python code.

  • by UnknownSoldier ( 67820 ) on Wednesday November 03, 2010 @04:23PM (#34116524)

    > and closing parenthesis is as trivial to any modern editor or IDE as managing any other aspect of syntax.

    That's a hinderance, not an advantage. I should be able to easily enter in blocks of code without having to rely on crutches like IDEs to make sure I have the correct number of parenthesis. While I admire LISP for its simplicity, elegance, and consistency, back in the Real World (TM) it has a lot of unncessary and redudant parenthesis that do nothing except clutter up code, making that crap near un-readable -- at least in C/C++ you can remove the braces for one-liners. Algol-like languages have a better mapping to mathematical functions. foo(x) vs (foo x)

    i.e.

    void foo( int x )
    {
          if (true-expresion)
          {
                  then-expression ;
          }
    }

    vs. the leading '(' is complely redundant but needed because of the syntax.

    (defun bar (x)
        (if (true-expression)
                (then-expression)
        )
    )

  • by Mike Buddha ( 10734 ) on Wednesday November 03, 2010 @04:31PM (#34116648)

    I'm with Junta on this one. If you're going to learn a first language, make it one that will grow with your knowledge. When I started out, it was with LOGO and BASIC. The LOGO stuff was pretty much mental masturbation, as it were. Yes, some of the concepts were transferrable to more modern, practical languages, but so were the concepts in BASIC.

    For a beginner, I'd recommend Python. It's a powerful language, freely available on just about every platform imaginable, with tons of support and it will take a user all the way from "hello, world" to mobile phone apps, to web services, to World of Warcraft.

  • by mangu ( 126918 ) on Wednesday November 03, 2010 @04:45PM (#34116798)

    Python does precisely that. It mixes presentation (what code looks like) with content (what code does).

    To some extent, every language does that. What I meant is that the TAB character introduces an arbitrary visual configuration that's not part of the language itself, which can confuse things when tabs and spaces are mixed in the same source file.

    However, this does not mean that the presentation of the code is unimportant. For instance, a reason why I once programmed in Pascal but switched to C was that I found braces easier to read than "begin ... end" pairs. Curly braces are clean and small symbols, looking at the source code at a glance they are easier to identify than multi-character keywords.

    When you are writing and reading code by the hundreds of thousands of lines, every detail becomes significant. That's something language theorists often fail to understand, but Dennis Ritchie and Guido van Rossum got perfectly right.

  • by Baldrson ( 78598 ) * on Wednesday November 03, 2010 @05:08PM (#34117026) Homepage Journal
    I find it amazing that, contrary to popular belief, the 21st century started in 1958 [wikipedia.org].

    Seriously, guys, who in their right mind believes there have been no major advances in programming languages since Lisp?

    Oh, I'll admit that 99.9% of the supposed "advances" have been horseshit...

  • by ultranova ( 717540 ) on Wednesday November 03, 2010 @05:33PM (#34117282)

    While I admire LISP for its simplicity, elegance, and consistency, back in the Real World (TM) it has a lot of unncessary and redudant parenthesis that do nothing except clutter up code, making that crap near un-readable -- at least in C/C++ you can remove the braces for one-liners.

    Thus saving a whole single character per line. That's real efficiency.

    Algol-like languages have a better mapping to mathematical functions. foo(x) vs (foo x)

    I wonder how many bugs have been introduced when people have confused Algol-like functions (which have side effects) with mathematical ones (which don't)?

  • by SuperKendall ( 25149 ) on Wednesday November 03, 2010 @06:01PM (#34117576)

    Python respects the visual limitations of humans

    It does exactly the opposite, unless humans can evolve to literally "see" whitespace characters.

    The zen-like empty indentation technique drove me mad when I had to maintain some python software. It reminded me for exactly the thing I hated most about the little Fortran I had done in school, the punch-card like need for rigid character placement in something that was, to my mind, meant to be a totally logical construct.

    As another poster noted, Python mixes presentation with content and that makes it really awful to do refactoring, or for tools to be able to offer you meaningful help in reformatting. A code reformatter can take a mess of code differently indented and make it correct according to your preferred spacing. It can also take pasted code and place it at exactly the right level of indentation. What is a code formatter to do when you try to paste code directly after an indented line of python? Any guess can be wrong, and all it CAN do is guess.

    I actually like the language otherwise, I like the constructs, but the whitespace thing makes it basically unusable for me in practice. At this point if I want to learn a nice alternative and powerful language, I'm going for Erlang.

  • by A Friendly Troll ( 1017492 ) on Wednesday November 03, 2010 @06:50PM (#34118152)

    Well, if only the TAB character had never been invented... TAB is a kludge to make a typewriter behave sort of like a spreadsheet but, unfortunately, it fucks up the excellent "Don't mix content with presentation" principle.

    I actually like tabs.

    I used to be in the "use spaces only" camp many years ago, but then I found out that I prefer proportional fonts to monospaced. When using those, you need more indentation; two or four spaces isn't going to be enough. So, I normally use tabs with the equivalent of six, and I switch to eight or ten when I'm dealing with highly-indented blocks of code.

    If I used spaces alone and inserted a whole bunch of spaces to accomodate for my font preference, whoever looks at that code later in a monospaced font would get a sudden urge to kill me.

    That's the whole beauty of it; in fact, tab characters *separate* content from presentation. A tab can be two spaces, or it can be ten. Meanwhile, spaces are just spaces. To put it differently, tabs are CSS, and spaces are inline style crud on HTML elements. So, to be honest, I really don't get your point.

  • Re:Lisp is cool... (Score:3, Insightful)

    by Darinbob ( 1142669 ) on Wednesday November 03, 2010 @08:39PM (#34119200)
    Dismissing lisp because of parentheses is like dismissing Citizen Kane because it was in black and white. It totally misses everything else in the language that's far more important. Lisp is a milestone in computer language history, it was extremely influential to modern fashionable languages, and it is still relevant. To miss all that because of some parentheses is short sighted.
  • by Darinbob ( 1142669 ) on Wednesday November 03, 2010 @09:05PM (#34119422)
    Any decent programmer should know more than one language. If they can't adapt to a new language, they need to spend some more time learning how to think differently. Preferably, one of the languages they know should be lisp-like. Not because it's necessarily relevant to today's web-based micro-apps, but because it can teach you to THINK differently.

    I know some programmers who know several languages, but they write as if every one of them was Fortran. You can lead the horse to water...
  • by MichaelSmith ( 789609 ) on Wednesday November 03, 2010 @09:26PM (#34119580) Homepage Journal

    A lot of it is working on site, often with borrowed equipment, and under fairly strict security limitations. I might get given the code in a zip file and have to edit it on windows on notepad. Or I might be using the console port on an alpha server running Tru64 4.0

    These are just examples. They are created by circumstances. Python places to much reliance on the text editing environment.

  • by Urkki ( 668283 ) on Thursday November 04, 2010 @02:55AM (#34121600)

    C doesn't care at all about indentation. You can remove all the lefthand space from a C program without affecting it in any way. Pythons meaningful whitespace is a terrible idea, absolutely horrific really.

    Well, C cares about indentation in the way, that indentation has to be spaces or tabs, if there's any. Worst of all worlds, which is discovered by anybody who has worked with mixed up tab-space settings in files in version control. Worst case is having different amount of space per tab been used in different parts of the code, and tabs not used consistently. Result is, no matter how you configure the editor, some part of the code gets indented unevenly, and you can't fix it without messing up version control diffs.

  • by shutdown -p now ( 807394 ) on Thursday November 04, 2010 @03:55AM (#34121826) Journal

    Funny. To date, Common Lisp still has the most powerful and feature-complete OOP system ever designed in a programming language.

  • by slim ( 1652 ) <john.hartnup@net> on Thursday November 04, 2010 @07:04AM (#34122594) Homepage

    Two comments about the summary:

    Programming today is easier than programming in the 80s, if you pick the right language. BASIC wasn't that easy -- although at least on most computers there was no installation step.

    Most people who typed in games from magazines weren't doing it to learn -- they wanted to play the game, and printing the BASIC code on paper was more cost effective for the publishers than gluing a cassette to the magazine. Typically there would be no comments, no discussion of the techniques use, and towards the end of this practice's lifetime, it wasn't unusual for the program to be a small piece of BASIC for poking integers into memory, followed by several A4 pages of hex characters; the machine code for the game.

8 Catfish = 1 Octo-puss

Working...