HackerTrans
TopNewTrendsCommentsPastAskShowJobs

wscp-dev

no profile record

Submissions

Java 21 makes me like Java again

wscp.dev
412 points·by wscp-dev·3 года назад·742 comments

comments

wscp-dev
·3 года назад·discuss
thank you for giving it a read!
wscp-dev
·3 года назад·discuss
I do believe that number will go down in the coming releases; things like valhalla will allow us to pack data representations much more efficiently after all. the only things that really benefit from object identity are behaviors, not data.
wscp-dev
·3 года назад·discuss
did that to make it a bit clearer what I was really optimistic about, but I unfortunately can't edit the hn post itself.
wscp-dev
·3 года назад·discuss
it's a matter of standardisation again. Java's standard is like C++; ponderous. The record pattern jep indicates in final footnotes that something like unapply may be in the works, so all hope is not lost.
wscp-dev
·3 года назад·discuss
I did title it that way at first but ended up changing it at the last second, ended up shunting it off course.
wscp-dev
·3 года назад·discuss
Ahh, true. I need to find a way to add sorting by recent updates to my site.
wscp-dev
·3 года назад·discuss
Ill add that in, somehow forgot about that golden bit of info
wscp-dev
·3 года назад·discuss
With valhalla, we will have explicit nullability as well, so that problem will also be handled.
wscp-dev
·3 года назад·discuss
That is true, but there are many who have discussed that. I wanted to bring some attention to the new syntactic changes Java brings that can help with implementing better logic.
wscp-dev
·3 года назад·discuss
Not by that much... the problem is Java's build systems. Theyre what complicate and slow down java development 90% of the time.
wscp-dev
·3 года назад·discuss
Oracle has definjtely done bad things; mismanagement of java is not one of them. They got a pile of crap and turned it into something competent.
wscp-dev
·3 года назад·discuss
What a marvel of engineering.
wscp-dev
·3 года назад·discuss
Id rather say use kotlin. It comes with a better type system with explicit nullable types, proper closures, and syntactic sugar to easily enavle beneficial programming patterns.

Nd it is very compatible with Java itself, interop is dead simple
wscp-dev
·3 года назад·discuss
Java has in recent times actually removed some apis from the standard library, and made some inaccessible (undocumented internal apis especially) so any advanced frameworks that use them would have been affected.
wscp-dev
·3 года назад·discuss
Yes/you/do/but/the/ide/does/it/for/you/so...
wscp-dev
·3 года назад·discuss
Thatll probably come in about a year or so going by the pace of valhalla's completion.
wscp-dev
·3 года назад·discuss
That is an extremely debatable topic. Which is why kotlin completely ignores checked exceptions.

Frankly, Id rather have a result and optional/nullable type like in rust/kotlin than deal with exceptions in any capacity.
wscp-dev
·3 года назад·discuss
[flagged]
wscp-dev
·3 года назад·discuss
I think the experience is better with more well designed languages like Kotlin, which can reduce boilerplate and allow you to focus on the handler and controller logic instead of boilerplate.

Regarding magic... I think it is a matter of pulling away the curtain; once you know how the DI works, it becomes drastically easier to write code with it, since you can predict its behaviour. I have always had trouble when I don't know all the rules of a system.
wscp-dev
·3 года назад·discuss
well... My company was aiming to do codegen to fix errors. We took quite some time to figure out what to do with AI in our product. When we finally implemented something, we found apis like gpt4 to be quite expensive, though GPT4 did work well for the task. We later turned towards llama2 and codellama, which worked decently but had a higher "wrong output" rate.

And then they laid off 60% of the workforce (We were only 30 people)... I am not sure LLMs are going to affect their outlook very positively in the long term.