News for hackers. Stuff that matters.
Re:The One Billion Row Challenge by wiseowise on Thursday January 04, 2024 @03:46AM (#38864656)
Ok, I’ll bite - why?
Re:The One Billion Row Challenge by winrid on Thursday January 04, 2024 @03:57AM (#38864723)
It looks like they mostly work in JS, so maybe it's the type definitions that look clunky.

Java is explicit, yes. This is intentional :)

Re:The One Billion Row Challenge by brrrrrm on Thursday January 04, 2024 @10:26AM (#38868076)
yea, I guess it's the lack of human-friendly default assumptions mixed with prescriptive design patterns. definitely an anachronistic design intent :(
Re:The One Billion Row Challenge by winrid on Thursday January 04, 2024 @03:10PM (#38871624)
have you worked with any compiled languages? It's not much different. It can get a lot worse ^_^. Java's one of the best languages to work in IMO.
Re:The One Billion Row Challenge by brrrrrm on Thursday January 04, 2024 @03:35PM (#38871904)
I work professionally in C++, but I wouldn’t tout it either.

I find Python to be the most pleasant personally.

Re:The One Billion Row Challenge by winrid on Thursday January 04, 2024 @05:41PM (#38873298)
Python with types is indeed great.
Re:The One Billion Row Challenge by promiseofbeans on Thursday January 04, 2024 @01:57PM (#38870828)
Funny thing is, most js devs do typescript now, which is the same as java, of not worse because you need an extra colon for your static types
Re:The One Billion Row Challenge by brrrrrm on Thursday January 04, 2024 @02:25PM (#38871138)
Weird to think typescript is similar to a language that requires a class definition for “hello world” lol. You can’t even fit it on a single 80 character line…
Re:The One Billion Row Challenge by winrid on Thursday January 04, 2024 @03:12PM (#38871645)
Putting everything in a class has some really nice benefits.

For example, for performance monitoring/debugging, it's really nice to see memory usage and thread creation by package/class. Whereas, I've seen teams spend weeks trying to find memory leaks in NodeJS applications, because you just get "here's general usage by object-shape". Would literally take me less than a minute with Java...

Re:The One Billion Row Challenge by brrrrrm on Thursday January 04, 2024 @10:20AM (#38867997)
it feels like the characters-typed to functionality ratio is quite low. at the same time, the code isn't much cleaner and there's a lot of mental overhead in deciphering the abstractions (in this case Collector).
Re:The One Billion Row Challenge by estiaan on Thursday January 04, 2024 @12:14PM (#38869579)
Java is probably the language I use the most but I hate how much boilerplate it has. Something I’ve found to help with that is using Java Records instead of classes, a record is kind of like a struct, but I don’t think it’s exactly the same, there’s no boilerplate and something I quite like about them is that their fields are immutable (more specifically “private final”) which works well with more functional programming, something that can be quite clunky with classes in java

Anyway I’m not a software engineer so take what I say about software with a grain of salt. Also I feel like other java programmers will hate you if they need to read or use your code. For example lets say you had a 2D point data type that is a record. instead of things being like “pos.add(5)” if pos is a record you need to reassign it like “pos = pos.add(5)” where add returns the pos as an object. Similar to how BigInteger works in java.

Anyway I love records because there’s zero boilerplate, it feels very similar to me to how structs are written in rust and go, or how classes are done in scala. I just never see anyone talk about it. I guess that might be because most people programming new projects on JVM are probably not programming in java?

Re:The One Billion Row Challenge by promiseofbeans on Thursday January 04, 2024 @01:59PM (#38870851)
> instead of things being like “pos.add(5)” if pos is a record you need to reassign it like “pos = pos.add(5)”... That's just mutable vs immutable data structures