Java sucks, and should stop being taught as the defacto language in computer science curriculums. It's extremely busy and verbose. There are better OO languages out there, if the point is to teach OO. (I'm ready for this post to get downvoted into oblivion)
Java sucking could be a good reason to teach it, no? It's instructive to know what bad choices have been made. Much like your first job, it can be unfortunate to work in a place where everything functions properly, because you won't know what makes it work. Java is also a good base for looking at other JVM languages, and for looking at the JVM itself. That's gotta be part of a good curriculum too, doesn't it?
New language features since Java 8 to 17
171–180 of 358 posts
Re: New language features since Java 8 to 17
#172Glad to see Java improve, but I still would like to see more ML features: - ~Exhaustive pattern matching~ it’s here! - Algebraic data types - Tail call optimisation - Do notation - Operator overload Why not use another language? Well, the name “Java” guarantees buy-in at this point. Maybe it will eventually be a Trojan horse for ML :)
What would do notation add to Java?
It’s great for avoiding nulls, but you get excessive nesting with many isPresent checks. Do notation can fix this.
The language even provides a bind function, but no reasonable way to use it!
Re: New language features since Java 8 to 17
#173Earlier quoted context omitted.
Counterpoint: it's become a fairly multi-paradigm language at this point, and a multi-paradigm language is exactly what should be the defacto language in curriculums Whether or not Java is the best one for this purpose is up for debate, but I think it's no longer a bad one
> Counterpoint: it's become a fairly multi-paradigm language at this point, and a multi-paradigm language is exactly what should be the defacto language in curriculums I'm surprised you would say this, as it is the exact opposite of my experience as university teacher. I think we should teach concepts , and concepts appear much more crisply in small and focused languages. I think students gain more from being exposed…
Another advantage of laying this kind of foundation is that even if the initial course stuck to a limited set of features, students could then go out and use the things they've learned and explore other features adjacent to them at their leisure, without going too far outside of that initial comfort zone (and - maybe most importantly - using the same tooling/environment setup, which can be the biggest barrier to new programmers who want to try out different technologies)
I'll admit though that this is mostly speculation on my part
Re: New language features since Java 8 to 17
#174Glad to see Java improve, but I still would like to see more ML features: - ~Exhaustive pattern matching~ it’s here! - Algebraic data types - Tail call optimisation - Do notation - Operator overload Why not use another language? Well, the name “Java” guarantees buy-in at this point. Maybe it will eventually be a Trojan horse for ML :)
What would do notation add to Java?
[0]: https://typelevel.org/cats-effect/ [1]: https://zio.dev
Re: New language features since Java 8 to 17
#175I’m stuck on 8 and 11 in my current projects, so I haven’t seen much of these in the field other than the new record feature. What I am really surprised about is the var construct. Honestly, this leaves me a little conflicted since it seems to be antithetical to the principles of a strongly-typed language. So does this now reclassify Java as a weakly- or dynamically-typed language? I would perhaps argue against it be…
Var and type inference are neither antithetical to static typing nor do they make a language dynamically typed. They're antithetical to the verboseness of Java.
Re: New language features since Java 8 to 17
#176Earlier quoted context omitted.
What's to be uneasy about? Lock your environments, pin your dependencies, especially in production.
Until your LTS OS gets to end of life and you need to switch to the next one which conveniently deprecates old python versions so you have to rewrite everything.
Re: New language features since Java 8 to 17
#177Java sucks, and should stop being taught as the defacto language in computer science curriculums. It's extremely busy and verbose. There are better OO languages out there, if the point is to teach OO. (I'm ready for this post to get downvoted into oblivion)
Also, you broke the site guideline asking people not to go on about downvotes in the comments. Would you mind reviewing https://news.ycombinator.com/newsguidelines.html and sticking to them in the future? We'd be grateful.
Re: New language features since Java 8 to 17
#178Earlier quoted context omitted.
Clojure tries to be an immutable-data, copy-on-write, threadsafe by default dialect of Lisp, which none of the other Lisps do.
It’s not really copy-on-write though. That implies greater systemic performance losses than what Clojure provides, because it uses HAMTs (Hash Array Mapped Trie) internally. They enable much faster copies of immutable data than copy-on-write does. Your other points are good ones, I just don’t want people to be put off by copy-on-write performance assumptions. You take a ~50% performance hit from choosing Clojure over…
(More precise issue... JDOM 1 lets you splice a piece of A into B while it still is part of A. JDOM 2 insists it be detached first. Detaching it removes it, and that removal can be seen through a reference.)
Re: New language features since Java 8 to 17
#179Java sucks, and should stop being taught as the defacto language in computer science curriculums. It's extremely busy and verbose. There are better OO languages out there, if the point is to teach OO. (I'm ready for this post to get downvoted into oblivion)
Counterpoint: it's become a fairly multi-paradigm language at this point, and a multi-paradigm language is exactly what should be the defacto language in curriculums Whether or not Java is the best one for this purpose is up for debate, but I think it's no longer a bad one
It's still very much an OO language with borrowed features.
> a multi-paradigm language is exactly what should be the defacto language in curriculums
Debatable. Multi-paradigm languages without a strong focus can overwhelm someone completely new.
Re: New language features since Java 8 to 17
#180It's good to see Java starting to waive a lot of the boilerplate. (And frustrating, when stuck on v8.)
A friendly advice: dont be afraid to use public final immutable fields and omit the getters (and setters since you cant have them w/ finals).