Live data from Hacker News

Rating 26 years of Java changes

neilmadden.blog

141–150 of 327 posts

Re: Rating 26 years of Java changes

#141

I’m sure there are better ways to do streams on the JVM, scala being a great example, but however imperfect the implementation is streams are such a net positive I can’t imagine the language without them. I pine for the streams API when I write go.

I totally agree with the criticism about exceptions. If you need exceptions inside a stream it turns into a mess.

Overall I agree with you. They are significantly better, even if a little verbose, than not having them. Love cleaning up old loops with a tiny stream that expresses the same thing more compactly and readably.

He’s also right on the parallel benefits not really being a thing I’ve ever seen used.

Re: Rating 26 years of Java changes

#142

I feel this is overly harsh on Collections. You have to take into account just how awful that which it replaced was. > Java Time: Much better than what came before, but I have barely had to use much of this API at all, so I’m not in a position to really judge how good this is. Again, it is hard to overstate just _how_ bad the previous version is. Though honestly I still just use joda time.

In my mind Java really got usable in 1.5 with collections and generics.

When you didn’t have collections everything was a complete pain. But after they were added you still had to cast everything back to whatever type it was supposed to be when you got stuff out of collections. Which was also a huge pain.

I know all the arguments about how genetics weren’t done “correctly“ in Java. I’ve run into the problems.But I’m so glad we have them.

Re: Rating 26 years of Java changes

#143
post #18

I haven’t used markdown in javadoc yet but this seems like at least 3/10? I often want to put paragraphs or bulleted lists in javadoc and find myself wanting to use markdown syntax for readability in the code but need to switch to less readable html tags for tooling to render it properly.

Personally it’s fine, I haven’t used it though.

I really wish Javadoc was just plain text that honored line breaks. I really don’t care about the fact I can put HTML in there, that just seems dumb to me. I get you can’t remove it but I would be happy if you could.

I do like markdown. But I don’t see myself ever using it in a Javadoc.

Re: Rating 26 years of Java changes

#144

Earlier quoted context omitted.

this is exactly why spring succeeded. I need to run a scheduled job, @EnableScheduling then @Scheduled(cron = “xxxxxx”) - done. I need XYZ, @EnableXYZ the @XYZ… sh*t just works…

And then I realize I need to change that schedule. And would like to do it without recompiling my code. Oh, and I need to allow for environment specific scheduling, weekdays on one system, weekends on others. And I need other dependencies that are environment specific. I much prefer Spring's XML configuration from the old days. Yeah, XML sucks and all that. But still, with XML, the configuration is completely externa…

I do realize you were intending to give examples of why you don't think annotations aren't very extensible, but it is an odd example as all those things can still be achieved via annotation, since the annotations can accept values loaded from env specific properties.

Re: Rating 26 years of Java changes

#145
post #113

Earlier quoted context omitted.

That's another gotcha-- interning of strings and boxed primitives. Are there linters for this sort of thing? I don't write Java much any more.

> Are there linters for this sort of thing? Yes and they're pretty good so it's rarely an issue in practice. Using == on object references will indeed usually get you yelled at by the linter.

I’ll say from experience that even if your IDE highlights that by default people won’t pay any attention to it and the bug will get in.

I’ll be happy when it’s fixed.

Re: Rating 26 years of Java changes

#146
post #16

-10 for modules is fair, only 4 for lambdas is not. My programming style changed after using lambdas in Java, even when using a different programming language later that doesn't have lambdas as such.

Lambdas + streams is fantastic. I think if you didn’t have them streams would just be a total mess to use.

Re: Rating 26 years of Java changes

#147

Fully agree with most votings but 3/10 text blocks?! That has got to be one of the most useful recent features. :-) The pleasure of just copying and paste text in plain ASCII that looks as intended rather than a huge encoded mess of "\r\n"+ concatenations. But ok, I'm just an ASCII art fan. ^_^

String sql = “Not having “ +

“to break up “ +

“SQL statements” +

“like this for readability “ +

“thus making them hard to edit “ +

“was incredibly useful at my job.”;

(Note: I put a subtle bug in there because it always happened)

SQL injection is horrible, but people were managing to do that all these years after prepared statements anyway without text blocks. I really don’t think they made things worse. Same thing with embedding HTML in the code. They were gonna do it anyway.

Re: Rating 26 years of Java changes

#148

Still no unsigned integer types in the standard library after 26 years?

It’s rare I have to do bit math but it’s so INCREDIBLY frustrating because you have to do everything while the values are signed.

It is amazing they haven’t made a special type for that. I get they don’t want to make unsigned primitives, though I disagree, but at least makes something that makes this stuff possible without causing headaches.

Re: Rating 26 years of Java changes

#149
My read is that it's easy to be quite negative on Java features when you're not the person they were designed for. For example, the main "customer" of the module system is the JDK itself. The main customer of NIO/2 is the low-level libraries like Netty.

I highly recommend the Growing the Java Language talk by Brian Goetz to anyone who's interested in the philosophy behind evolving the modern Java language [1]. And Don’t be misled by the title, it’s not just about Java, it’s about software design.

[1]: https://www.youtube.com/watch?v=Gz7Or9C0TpM

Re: Rating 26 years of Java changes

#150

I haven't written much Java but I am learning Kotlin and I really appreciate the language and the whole JVM ecosystem. Yeah yeah, Gradle is complicated but it's waaaaay easier to figure out than my adventures with Cmake, and when I read Java code there is a certain comfort I feel that I don't get with other languages, even ones I'm experienced with like Go. Java feels a bit like a stranger I've known my whole life, s…

Maven was peak Java build tool. I detest Gradle. Some people just hate XML enough to doom us all.

I wouldn’t say I’m a fan of maven, but it is absolutely one of the best build/dependency tools I’ve ever used despite its warts.

So many things, even if they came much later, are somehow much worse.

Post reply on HN