3 ms·
I love lisp. I use/used it to build my web service product[1] and anything else I can. =how do I do X?= java: something similar to X is already done in Y. add
by thecombjelly 14y ago
I love lisp. I use/used it to build my web service product[1] and anything else I can.
=how do I do X?=
java: something similar to X is already done in Y. add abstract class and redo X and write Y. +200 LOC
lisp: something similar to X is already done in Y. realize you can generalize X and Y into a new pattern and use it for ABC too. -70 LOC
=there is a bug in function X=
java: open X.java. edit line. restart program. X seems to be working correctly.
lisp: two hours later, ah ha! I understand this code. fix X. write unit test. eval unit test. X works correctly.
[1] demo: https://a.keeptherecords.com/demo https://a.keeptherecords.com/demo, source: https://github.com/ThomasHintz/keep-the-records https://github.com/ThomasHintz/keep-the-records
- theevocater 14y agolook I like lisp as much as the next guy, but you can "spend two hours" reading java code, write a unit test; eval said test and then woohoo! You can do that in basically any modern language. And your first example is something that most modern languages are sold on. The truthiness of those statements can be debated, but your examples are flawed to say the least. Point is: you can generalize and write unit tests in any language.
- thecombjelly 14y agoThat is true to a degree but you really can not generalize very well at all in java. You will also be hard pressed to find java code written functionally enough that you can just run a unit test and know it is working correctly. Usually you have to instantiate many other classes and stub in test data via something like guice. There are many places for those bugs to hide in that type of setup.
- manish_gill 14y agoI'm foraying into the lisp land for the first time with SICP, and the one thing that bothers me the most is that Scheme is so hard to debug. As a Python programmer who is used to just used to print debugging, this becomes very frustrating very early on.
- groovy2shoes 14y agoWhat's preventing you from print debugging in Scheme? For convenience, I almost always define something like this: (define (println . args) (for-each (lambda (arg) (display arg) (display " ")) args) (newline))