3 ms·
Lisp code I write today may run 10 years from now, but would I be able to read it a month from now? Maybe I just never got familiar enough with it, but code I w
by jmugan 5y ago
Lisp code I write today may run 10 years from now, but would I be able to read it a month from now? Maybe I just never got familiar enough with it, but code I wrote for my AI class was meaningless to me 6 months later.
- Jtsummers 5y agoThat's a general problem, not a Lisp problem. Code will always be harder to read later, especially code from when someone was new to the language (I wouldn't want to read most of my grad school AI class code from 15 years ago either). But that's not unique to Lisp code. My Java, Python, C, C++, Smalltalk, SML, Scheme, Prolog code from other courses in college would almost all be pretty incomprehensible (depending on the scope of the particular project it was composed for, and how far into my academic career it was written). If you're a moderately experienced programmer and you spend more than a few weeks learning Lisp, you should be able to write code that's perfectly understandable months later.
- lispm 5y agoOne better be able to read old code. For example the first lines of the SBCL Lisp implementation were written around 1980, when it was called Spice Lisp. The version from 1984 looks readable: http://www.softwarepreservation.org/projects/LISP/cmu/Spice_Lisp.tar.gz/view http://www.softwarepreservation.org/projects/LISP/cmu/Spice_...
- wglb 5y agoThere are Fortran II program that I wrote decades ago that I would totally struggle to remember what was going on. I have had the same experience with C++ that I wrote years ago.
- dreamcompiler 5y agoIt's very common for me to revisit Common Lisp code I wrote 20 years ago because it still works and I've forgotten what algorithm I used. Within a couple of minutes I have one of two reactions: "Hey that was pretty clever" or "I get how this works but this coding style is idiotic." Usually the latter. So yeah, I can glance at a Common Lisp program and tell pretty quickly what it's doing. That comes from studying 10,000 Common Lisp programs. It's pattern recognition.
- pfdietz 5y agoThe other reaction is "why didn't I write more comments". Old me hated future me, I guess.