Earlier quoted context omitted.
Fair enough, but attaching multiple debuggers across several interacting components with conditional breaks gets me there faster than incrementally inserting progressively more print statements, in a dev environment. Proper logging is a given doping out problems in a production system to then verify and correct in dev.
Logs aren't a bad thing and they aren't going away. Whoever let's you setup debuggers on prod should be fired.
Why I love Common Lisp and hate Java (2012)
31–40 of 171 posts
Re: Why I love Common Lisp and hate Java (2012)
#32Earlier quoted context omitted.
I disagree. Most of the time, I find a debugger just slows me down. It's super helpful in some cases, but good logs can pinpoint problems far before a debugger can. Also, building in debug mode can change everything, so you may not even catch your bug, especially if it's concurrent in nature.
I think there are two use cases here, I was referring to debugging during development and a lot of replies are regarding troubleshooting an active prod system. Of course we all hope for well thought out logging to troubleshoot issues we're seeing in prod. I'm referencing an pattern I see with junior devs who simply use "printf debugging" in development instead of learning to use a debugger properly, even with distrib…
Whereas I see this pattern more with senior engineers.
Re: Why I love Common Lisp and hate Java (2012)
#33It is a recurring theme for people to point out how verbose a hello world program is in Java: class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } } For argument sake, let's compare it not to Lisp but to Python instead: print("Hello World!") Once you get proficient in a language and start writing larger programs, your perspective can change entirely. What appears to be…
Totally agree with you - I like Java precisely because it's so verbose. I'd rather have to type 20% more than spend 20% more time figuring out other people's code. And honestly, I always feel that the Hello World example is kind of biased. It's more an example of Java's way of launching a program being verbose because every program requires a certain minimal structure. But for the rest of the entire Java language tha…
Re: Why I love Common Lisp and hate Java (2012)
#34Earlier quoted context omitted.
And lambdas were introduced in 8 making nearly all of the author’s issues mute.
What about closures? Also, those lambdas are actually classes that try very hard to look like lambdas, but aren't actually.
Re: Why I love Common Lisp and hate Java (2012)
#35Earlier quoted context omitted.
> Do you really want print() to be so easily accessible in the top-level namespace? It seems to me that the bigger an application gets, the worse it is to easily litter the codebase with print statements. Yes? It's great for debugging, which is generally what you'd use a print for anyways in a large application.
Whats even better than print for debugging is using a debugger...
Re: Why I love Common Lisp and hate Java (2012)
#36Earlier quoted context omitted.
Fair enough, but attaching multiple debuggers across several interacting components with conditional breaks gets me there faster than incrementally inserting progressively more print statements, in a dev environment. Proper logging is a given doping out problems in a production system to then verify and correct in dev.
Logs aren't a bad thing and they aren't going away. Whoever let's you setup debuggers on prod should be fired.
I would rather argue that such incompetent managers who speak such nonsense need to be fired.
Re: Why I love Common Lisp and hate Java (2012)
#37It is a recurring theme for people to point out how verbose a hello world program is in Java: class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } } For argument sake, let's compare it not to Lisp but to Python instead: print("Hello World!") Once you get proficient in a language and start writing larger programs, your perspective can change entirely. What appears to be…
It's just convenient for a scripting language to be able to print stuff without any code structure. Something that Java enforces.
I've concluded it's because Java isn't designed for scripting that it doesn't allow scripting practices in its code bases. I just started learning Java and I guess if I use a class that could throw an exception I have to catch it (or transfer it to my class' user it seems). In this particular test I knew it wasn't gonna throw but it wouldn't compile: I was opening a file I knew existed for some quick test - instead of 1 python line I got 7 java ones. But with exception / catch structure.
It's an enterprise language, I'm all for the code structure enforcement. Help a dev catch an exception, so many things could already go wrong on larger codebases ;)
Re: Why I love Common Lisp and hate Java (2012)
#38Earlier quoted context omitted.
> Do you really want print() to be so easily accessible in the top-level namespace? It seems to me that the bigger an application gets, the worse it is to easily litter the codebase with print statements. Yes? It's great for debugging, which is generally what you'd use a print for anyways in a large application.
You really should be using a logging framework instead though, if you're working on a large application.
Re: Why I love Common Lisp and hate Java (2012)
#39Beside the REPL, another impressive feat of Common Lisp is meta-programming. You can write software to write software. Say what? Yeah, that was my initial reaction too, but Common Lisp’s macro system allows you to write functions that return code snippets. It completely redefines the word. Or more accurately, re-redefines, since Lisp is much older than MS Office, which is what most people associate macros with, sadly…
Re: Why I love Common Lisp and hate Java (2012)
#40If you are running JDK 9 or later, you can use jshell: jshell> "Hello World!" $1 ==> "Hello World!" https://openjdk.java.net/jeps/222
Turns out C# also has a REPL now, it's called "C# interactive". I've found out just now, spurred to look for it by your post.