Hacker News new | past | comments | ask | show | jobs | submit login

>"The difference between Lisp and Java, as Paul Graham has pointed out, is that Lisp is for working with computational ideas and expression, whereas Java is for expressing completed programs. As James [Gosling] says, Java requires you to pin down decisions early on..."

My experience with modifying Lisp and Java programs has largely been the opposite. I've been working on a Java application for the past few weeks, and the design of the program has changed several times as I've thought of new features to add and cleaner ways to organize my code. Today, I had a class X that was responsible for keeping track of a certain variable, and I wanted to move that responsibility to class Y. I deleted the relevant field and all references to it in class X, and Eclipse highlighted all of the errors that change introduced. I fixed the highlighted errors and added the new methods I needed to class Y, and when I tested the relevant functionality, I saw that I had introduced only one minor bug, which I fixed with a single line of code. There was nothing difficult about the process.

I've found refactoring Lisp programs to be more difficult. When I was writing a prototype of this same application in Lisp (Clojure more specifically), I had a macro to implement a small DSL. The macro was not particularly complex, although it was non-trivial: it did some code walking and called some helper functions. When my DSL grew past a certain size, making changes to its implementation became rather difficult. Sometimes the compiler would report errors at runtime, but more often than not, things would just stop working in mysterious ways whenever I made a change. The macro's output was also quite different than the kind of code I would write by hand, so debugging was difficult.

I'm not the best Lisp programmer, so I'm not trying to say that Lisp always makes it hard to change your programs. But there are cases where Java makes it very easy to change your programs.

Tooling around Java (e.g. Eclipse) has developed significantly since the time this article was written. If you're working in programs where the system is too big to fit in your mind, good tooling certainly helps. Lisp is especially powerful for programmers who are able to work with large and complex mental models of systems.


Debugging Lisp in Lisp is far superior (easier) compared to debugging Lisp in Java (which is what you get when you use Clojure). Clojure has been getting a lot of press as being the rebirth of Lisp, and it includes some useful paradigms in the core language, but it is woefully incomplete as a full Lisp development system when compared to mature Common Lisp implementations.

Out of curiosity, what do you see as the difference between Common Lisp debugging and Clojure debugging? I'm mostly experienced with Clojure (my CL code consists of a few trivial programs), but it seems like Lisp in the right environment (Emacs, paredit, SLIME/nrepl) is a joy regardless of which Lisp.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact