Live data from Hacker News

Rating 26 years of Java changes

neilmadden.blog

261–270 of 327 posts

Re: Rating 26 years of Java changes

#261
post #257

Earlier quoted context omitted.

Do you really think that in 26 years of professional Java programming I’d have never touched Spring? I’ve been using Spring since it was first released. I’ve found CVEs in Spring ( https://spring.io/security/cve-2020-5408 ). Trust me when I say that my dislike for Spring (and annotations) is not based on ignorance.

It's perfectly possible to work for 26 years with Java and not ever seriously touch Spring, or AWT, or Swing, or the EE bits, etc. Java is sprawling, and a corporate backend developer and a mobile frontend developer may have little intersection in the big libraries, and even the approaches, they use. It's perfectly fine to never have touched Spring. What surprised me is not acknowledging that not only are annotations…

Java is sprawling now. It wasn’t 26 years ago.

Re: Rating 26 years of Java changes

#262
post #89
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.

I hate using html in comments. Markdown in javadoc is at least 7/10 for me. Improves comment readability for humans while allowing formatted javadocs.

I wish C# would add this too. I despise having to write docs in XML style

Re: Rating 26 years of Java changes

#263
post #253

Earlier quoted context omitted.

Do you really think that in 26 years of professional Java programming I’d have never touched Spring? I’ve been using Spring since it was first released. I’ve found CVEs in Spring ( https://spring.io/security/cve-2020-5408 ). Trust me when I say that my dislike for Spring (and annotations) is not based on ignorance.

But your dislike can be a lot of other things which are not objective the slightest sense. I mean, your whole article is a subjective piece. Also, stating about something that you “dislike” something as large as Spring as a whole is usually a huge red flag for anybody, just like how liking it without reservations is also a huge red flag.

Yes, of course it’s (largely) subjective. But I have actually read much of the source code of Spring. I know it _very_ well.

Re: Rating 26 years of Java changes

#264
post #245

Earlier quoted context omitted.

Idealized checked exceptions are isomorphic to Rust's `Result` type, which is great. Java's implementation of checked exceptions has some issues, though. * "Invisible control flow", where you can't tell from the call site whether or not a call might throw (you need to check the signature, which is off in some other file, or perhaps visible in an IDE if you hover). * Java has both checked and unchecked exceptions, but…

Do you not have to check the signature to see what a function can return when using Results? It’s off in another file too. > failing to make a clean distinction between recoverable errors and unrecoverable bugs Recoverability is context specific. One persons panic may just be another error case for someone else. I think this is one thing that programmers miss when talking about this topic. It is really up to the call…

The point of avoiding invisible control flow is not to identify the type of the error, but to identify all locations in the code where recoverable errors may occur.

> One persons panic may just be another error case for someone else.

We can make a strong distinction between recoverable errors which the programmer anticipated (e.g. this I/O operation may fail) versus unrecoverable errors resulting from unanticipated bugs which may leave the process in an unsound state, such as divide-by-zero or out-of-bounds array access[1].

There are some problem domains where even unrecoverable errors are not allowable, and programmers in those domains have to grapple with the panic mechanism.

But for the rest of us, it is useful to be able to distinguish between recoverable and unrecoverable errors — and to know how we have handled all possible sites which could result in recoverable errors.

[1] Joe Duffy explains it well: https://joeduffyblog.com/2016/02/07/the-error-model/#bugs-ar...

Re: Rating 26 years of Java changes

#265

Earlier quoted context omitted.

What if I told you - you can use a batteries-included framework, and still write your own libraries specifically only for things you want your own version of and want to share across projects? The problem isn't that I don't know how to use a batteries included framework. The problem is that you guys don't know there is even an option to reuse your code by writing libraries.

Why are you assuming you cannot write your own library and use it with Spring? It's not an either/or, just like most frameworks are. You are framing it as if there is only one way to do it in spring. Please do not project things like "you guys don't even know..". I'm one of "you guys" , and have built production code in a variety of languages and frameworks. So this "you guys" knows exactly what he/she is talking abo…

> Why are you assuming you cannot write your own library and use it with Spring?

I am not. I am literally saying the exact opposite.

Re: Rating 26 years of Java changes

#266

Earlier quoted context omitted.

All this because I told one guy who asked "what exactly is “cronService”? you write in each service or copy/paste each time you need it?" that they can reuse code by writing a library instead of copy/pasting it? If this is the level of incompetence encouraged by a framework, I would avoid using it just to avoid the chance of hiring people like you. Just kidding. Spring boot is great. But yeah, I would fire people wit…

* Why would I write my own database driver or encryption just because I wanted to implement my own "cronService"?* how do you decide whether you will write your own or pull in a dependency? this is a legit question. you did start this with writing your own “cronService” (which is about as insane as writing your own database driver) so asked about it.

> you did start this with writing your own

I really did not. I only said that if you were to create your own cronService, you can reuse it by creating your library rather than copy pasting code (which is obviously insane).

> which is about as insane as writing your own database driver

No, it is not. Spring Boot’s support for async jobs and scheduled jobs is lacking. A lot of people roll their own. Including yours truly.

It is also much easier than writing a database driver so there is that.

Re: Rating 26 years of Java changes

#267
post #243

Earlier quoted context omitted.

> For example they used checked exceptions. Those are from java 1.0 and thus don't appear to be relevant to the part of the discussion I think this part of the thread is about (namely: "Why doesn't java crib well designed features from other languages?"). > Java went with checked exceptions and nowadays they are almost universally ignored by developers. They aren't. Note that other languages invented for example 'Eit…

All modern languages are adopting a checked error system: Rust, Swift, Kotlin, Zig, Gleam; they all have some type of error you must handle. The problem with Java is that they haven’t added the syntax to make dealing with those errors easy. It’s boiler plate hell.

Yeah, unwrapping a Result in Rust can often be done via a single character, the chainable `?` operator.

That’s not the only issue, though: Java also shunts both checked and unchecked exceptions through the same mechanism, conflating them. It’s no wonder that Java’s problematic implementation of checked exceptions has poisoned people against the concept.

Re: Rating 26 years of Java changes

#268

Earlier quoted context omitted.

Why are you assuming you cannot write your own library and use it with Spring? It's not an either/or, just like most frameworks are. You are framing it as if there is only one way to do it in spring. Please do not project things like "you guys don't even know..". I'm one of "you guys" , and have built production code in a variety of languages and frameworks. So this "you guys" knows exactly what he/she is talking abo…

> Why are you assuming you cannot write your own library and use it with Spring? I am not. I am literally saying the exact opposite.

Okay, that's fair. I don't even know anymore what point you are trying to make.

Re: Rating 26 years of Java changes

#269
post #253

Earlier quoted context omitted.

But your dislike can be a lot of other things which are not objective the slightest sense. I mean, your whole article is a subjective piece. Also, stating about something that you “dislike” something as large as Spring as a whole is usually a huge red flag for anybody, just like how liking it without reservations is also a huge red flag.

Yes, of course it’s (largely) subjective. But I have actually read much of the source code of Spring. I know it _very_ well.

From my point of view, it seemed from you article that you didn't even really understand functional languages in two decades (at least Haskell), which it seemed you to try to state also. So that doesn't matter too much.

Anyway, I just wanted to say, that it's totally pointless to state something like "I know it well"... Say what's your problem with it, "I don't like it" doesn't add anything to the conversation. I'm quite sure whatever you would say as problems, most people would agree, maybe there would be even tips under it how to prevent it. That will never happen with the kind of comments which you made above.

Re: Rating 26 years of Java changes

#270
post #257

Earlier quoted context omitted.

It's perfectly possible to work for 26 years with Java and not ever seriously touch Spring, or AWT, or Swing, or the EE bits, etc. Java is sprawling, and a corporate backend developer and a mobile frontend developer may have little intersection in the big libraries, and even the approaches, they use. It's perfectly fine to never have touched Spring. What surprised me is not acknowledging that not only are annotations…

Java is sprawling now. It wasn’t 26 years ago.

Just 20 years ago it was already sprawling.
Post reply on HN