Earlier 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...
Why I love Common Lisp and hate Java (2012)
11–20 of 171 posts
Re: Why I love Common Lisp and hate Java (2012)
#12If you are running JDK 9 or later, you can use jshell: jshell> "Hello World!" $1 ==> "Hello World!" https://openjdk.java.net/jeps/222
And lambdas were introduced in 8 making nearly all of the author’s issues mute.
You're right, but to be fair the article is almost 7 years old, and Java has evolved a lot.
Re: Why I love Common Lisp and hate Java (2012)
#13If you are running JDK 9 or later, you can use jshell: jshell> "Hello World!" $1 ==> "Hello World!" https://openjdk.java.net/jeps/222
Re: Why I love Common Lisp and hate Java (2012)
#14Earlier quoted context omitted.
Whats even better than print for debugging is using a debugger...
Doesn't quite work when debugging a distributed system, though. You end up adding a lot of "distributed print", AKA logging.
Re: Why I love Common Lisp and hate Java (2012)
#15If you are running JDK 9 or later, you can use jshell: jshell> "Hello World!" $1 ==> "Hello World!" https://openjdk.java.net/jeps/222
And lambdas were introduced in 8 making nearly all of the author’s issues mute.
Take lambdas for example, the amount of arbitrary exceptions you have to keep in mind while using them makes it almost not worth the effort. It's still the same old crappy Java; only with shiny, barely working marketing gimmicks duct taped to the side.
Re: Why I love Common Lisp and hate Java (2012)
#16Earlier 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)
#17Earlier quoted context omitted.
Doesn't quite work when debugging a distributed system, though. You end up adding a lot of "distributed print", AKA logging.
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.
Re: Why I love Common Lisp and hate Java (2012)
#18If you are running JDK 9 or later, you can use jshell: jshell> "Hello World!" $1 ==> "Hello World!" https://openjdk.java.net/jeps/222
And Swift is a much better designed language for this than Java.
Re: Why I love Common Lisp and hate Java (2012)
#19It 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…
> 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.
Re: Why I love Common Lisp and hate Java (2012)
#20It 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…
This design makes sense from conceptual purity, but Java is never a conceptually pure language. It distinguishes value types and object types, for instance. Not allowing free functions is really just a poor design choice.
Worse, the proliferation of single-method interfaces (which are really just functions) and static methods (which are in most cases really just free functions) really prove that free functions are useful. Java just makes it harder to use them.