Re:Why I love Common Lisp and hate Java (2012)
by rococode on Saturday November 03, 2018 @09:15PM
(#18373455)
You really should be using a logging framework instead though, if you're working on a large application.
[ Parent
| on HN ]
Re:Why I love Common Lisp and hate Java (2012)
by WaxProlix on Saturday November 03, 2018 @09:33PM
(#18373517)
Except you don't want to have your logger in all places: unit tests, early in startup lifecycle when guice or spring haven't wired everything up yet, etc. Printing to stdout is simple and ubiquitous.
Re:Why I love Common Lisp and hate Java (2012)
by dragonwriter on Sunday November 04, 2018 @04:08AM
(#18374975)
> Except you don't want to have your logger in all places
Yes, I do.
Now, I may have to work with a language/ecosystem that makes that awkward, sure, but that's a problem, if an incredibly common one (Julia is one of the few languages that avoids it.)
Re:Why I love Common Lisp and hate Java (2012)
by akvadrako on Saturday November 03, 2018 @09:31PM
(#18373511)
You use logging for production, but if you just want to see what a value is while when you run your program in the IDE and might not for a logger imported, print is handy.
Re:Why I love Common Lisp and hate Java (2012)
by all2 on Sunday November 04, 2018 @12:07AM
(#18374149)
Coming from python I like to set a breakpoint, and dive in with pdb. It's super easy to navigate through the stack frame and poke around to see what all the variables are. I get more out of inspecting state from inside of pdb than I do out of print statements.
On the other hand, I tend to use only print statements when I'm roughing in a program in an iPython Notebook. This gives a sort of visual documentation when navigating a library that I'm new to, and allows me to glance back at a verbose description of otherwise opaque data structures.
Re:Why I love Common Lisp and hate Java (2012)
by rpeden on Saturday November 03, 2018 @09:54PM
(#18373605)
If you're running from an IDE and want to inspect values, why not just set a breakpoint?
Re:Why I love Common Lisp and hate Java (2012)
by tormeh on Saturday November 03, 2018 @10:31PM
(#18373749)
Doesn't work with multithreaded applications and works poorly with non-deterministic behavior, so sometimes you just have to print lots of info and see if anything interesting pops up. It also requires knowledge about tooling for the language you're working on right now, which as a polyglot you might not care to learn.
Re:Why I love Common Lisp and hate Java (2012)
by LoSboccacc on Sunday November 04, 2018 @07:05AM
(#18375476)
Nah there's debugging for that