Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

501–510 of 777 posts

Re: Java 21 makes me like Java again

#501
post #78
post #54

Earlier quoted context omitted.

Only if you're using vim like someone from the 70s, otherwise any sane IDE handles those things for you But, yes, namespaces are still mapped to paths, it's not like they rewrote the JVM to use blockchain or something

Yeah I really like my IDE doing stuff in the background without me knowing shit about it.

Then you’d be thrilled to hear about all the stuff your NVME drivers are doing in the background without you knowing shit about it. Or maybe you prefer to engrave your ones and zeroes in stone by hand?

Abstractions exist for a reason. In Java, that abstraction is coding in classes and packages, not files of text.

Re: Java 21 makes me like Java again

#502
post #480

Earlier quoted context omitted.

> Java (and preferably Kotlin) are a lot more serious about making sure your code is robust before it compiles. You are making great points for Rust, Ocaml and Haskell.

There isn't all that many plus in their type systems that is not expressible in Java. OCaml and Haskell has Monads, sure. There is Scala for that on the JVM.

Is it possible to express Rust enums (tagged unions) and especially the option type in Java? Ofcourse. But the power of good type system doesn't come from the fact if you can express something, but rather how seamlessly it is integrated in to the language.

Re: Java 21 makes me like Java again

#503
post #486

Earlier quoted context omitted.

How long until we get continuations in Java? Maybe another 10y? How long until we get TCO? Lets say 20y? And in the end it will still not feel clean or as neat as other languages, that had this stuff for multiple decades.

None of those are a necessity, and they can be easily implemented in an additional layer (e.g. annotation processor if you really wanted to).

No language features above machine code are a "necessity". Java is not a "necessity". "OOP" is not a "necessity" either. Why don't we all work in C? Or maybe all in assembly language? Yet most of us are glad we can work at a higher level. Probably no single language feature is a "necessity", yet when they come together they make for higher level languages and elegant expression.

Re: Java 21 makes me like Java again

#504

Earlier quoted context omitted.

Google invented Go. Netflix uses Java and Rust and Go. Twitter used to use Scala. GitHub uses Ruby on Rails. EpicGames uses C++. Instagram uses Python. Everybody uses something. Now, if you have building on top of your organizations previous 10 years of engineering, you’re probably going to be writing Java and it’s probably going to be complicated. I’ve been there. I wrote Java for 15 years. I won’t anymore. I’m in l…

> Google invented Go. A handful of people at google invented golang is the more correct thing to say. Yet, google continues to use Java at a much much bigger scale than golang. golang is simplistic, not simple. Once you work on large golang code bases you'll see the challenges and messes it causes.

I work on really large go codebases

Re: Java 21 makes me like Java again

#505
post #338
post #308

Earlier quoted context omitted.

Microsoft uses C# internally and has a vested interest in making it better for all of its own developers, as well as making it good to increase industry adoption so it has a larger pool of skilled developers to hire from. Your arguments about who backs the language don't hold water.

Does it have a vested interest to make everything work cross-platform?

For both reasons mentioned above, yes. Even internally, many teams in Microsoft are shipping containers on Linux for prod services.

Azure is also the big moneymaker, so these days they want all their technologies to have Linux support since that's the dominant cloud OS.

Re: Java 21 makes me like Java again

#506
post #325

Earlier quoted context omitted.

It’s because C# is only really nice on the surface. As soon as you actually do something with it that takes it beyond its cozy CRUD, it becomes such a nuisance to work with. We have an ODATA client that we build our selves to use in our React frontend. Now, this would obviously not have been something we also used on the backend if we knew what we know now, but it’s the perfect example to illustrate my decades of exp…

Your issue seems to be with packages provided by Microsoft, not C# language itself. Model builder magic is part of those packages, not C# language. These types of libraries often make simple things quick and easy, but complex things (or just simple customization) much harder or even impossible.

I've seen this response before, but why on earth would we be using C# if not for its included batteries? I can't imagine a world where we would have chosen C# to write an API unless there were some specific benefits, and while I may be wrong to assume this, I don't think I've ever met someone who would. Not so much because there is anything wrong with C# or .Net for that matter, it's okish, it's just well... Honestly, writing C# is a lot like writing typescript with bad linting rules, at least to me. It's not that bad, but it's also not something I'd ever really want to do.

Re: Java 21 makes me like Java again

#507
post #40

The problems with Java can't be fixed by adding new things, you can't undo decades of ecosystem development, training, and ideology built on top of the idea that inheritance is really good idea and belongs everywhere. edit: I will say that as a Java developer I am grateful every day for the improvements to the language. Java is a very impressive language and I have a lot of respect for the people working on it.

Please ELI5 what is wrong with inheritance and/or how Java have it wrong. Do we need to go back to a new object oriented undegraduate course? Genuinely asking.

If you want to see how codebases work without inheritance in practice, I suggest checking out Go, which features polymorphism through interfaces, but not full-fledged inheritance

Re: Java 21 makes me like Java again

#508
post #502
post #480

Earlier quoted context omitted.

There isn't all that many plus in their type systems that is not expressible in Java. OCaml and Haskell has Monads, sure. There is Scala for that on the JVM.

Is it possible to express Rust enums (tagged unions) and especially the option type in Java? Ofcourse. But the power of good type system doesn't come from the fact if you can express something, but rather how seamlessly it is integrated in to the language.

Rust has sum types named wrongly as enums, which java also has as sealed interfaces. The option type is just one example for a sum type, which is as easy to express in Java as

  sealed interface Option permits Some, None {
    record Some(T value) {}
    record None() {}
  }
Sure, you have written 3 words more than Rust, and?

Re: Java 21 makes me like Java again

#509

Earlier quoted context omitted.

Do you feel good about yourself, talking down on people that made a perfectly valid choice by developing software in Java? Let's look at the alternatives you mentioned: Rust and Golang. Java compared to Golang is a much more expressive language. Java compared to Rust is a much easier language because you have a garbage collector for the majority of the cases you don't need the manual memory controls that Rust offers…

Manual memory controls? What are those? Rust does not have "manual memory controls". You write the code so that the borrow checker does not complain. End of story.

Those are pedantic semantics. I assume you know what I mean. But I'll explain it to you: with Rust you are in control of how memory is managed. Indeed through the borrow checker.

Re: Java 21 makes me like Java again

#510
post #225
post #167

Earlier quoted context omitted.

Wtf, so what do you think Django is?

I'm curious to understand what dependency injection is in Django that you're referring to? I know pytest does DI with fixtures, and trying to figure out what you're pulling into a test can be difficult.

In django you're importing a default cache, a default storage etc, and write your code to the interface. In settings.py you wire it all up. It's basically the same, for testing you would have to mock the import or provide some implementation.
Post reply on HN