5 ms·
Well, they removed code that was always discouraged from using and it was always and explicitly stated, that there are no guarantees of any kind when using this
by valenterry 3y ago
Well, they removed code that was always discouraged from using and it was always and explicitly stated, that there are no guarantees of any kind when using this code. The code was not living in a package called "unsafe" and being undocumented (to my knowledge) by coincidence.
So while Java broke some big libraries/frameworks (not "pretty much everything though"), it can't really be blamed on them.
In fact, look what Go has: https://pkg.go.dev/unsafe https://pkg.go.dev/unsafe
> Package unsafe contains operations that step around the type safety of Go programs.
> Packages that import unsafe may be non-portable and are not protected by the Go 1 compatibility guidelines.
Let's wait until Go has reached Java's maturity and see what happens when they change this package ;)
- jerf 3y ago"Let's wait until Go has reached Java's maturity and see what happens when they change this package ;)" They did a while back, actually. Compare https://pkg.go.dev/unsafe@go1.0.1#Pointer https://pkg.go.dev/unsafe@go1.0.1#Pointer with https://pkg.go.dev/unsafe#Pointer https://pkg.go.dev/unsafe#Pointer , in particular the modern very precise description of exactly what you can do with an *unsafe.Pointer. I'm not sure what the cutoff for that was but it was a while ago, yes. Still, it didn't do much.
- valenterry 3y agoInteresting! Personally I'm not a big fan of either Java nor excessive backwards compatibility. But I can't avoid noticing that a lot of people praise Go for things like the backwards compatible while despising Java at the same time, even though both languages are extremely similar in lots of regards.
- geodel 3y agoIt is not clear that people despise Java or they despise backward compatibility of Java. Because I haven't see anyone despising Java's backward compatibility.
- valenterry 3y ago> Because I haven't see anyone despising Java's backward compatibility. I'm happy to have beers, just so that you get the chance to see someone like that. :-)
- adrianmsmith 3y ago> So while Java broke some big libraries/frameworks (not "pretty much everything though"), it can't really be blamed on them. I think one of the reasons people use Java is to get access to those big libraries/frameworks. I've worked at a few companies that used Java during the transition, so maybe I had access to about 10 Git repos that underwent this transition. I think pretty much all of them required some tweaking e.g. adding extra dependencies in Maven when moving from Java 8 to Java 11. I actually became the "go to" person to do these transitions, having worked out what incantations were needed. All of those repos, to this day, despite the effort that was put into them during the transition, now print out warnings about things being unsafe. The companies just ignore those warnings. I have 15 years of Java experience and I don't know what to do about them. My understanding is this is normal in the Java world now. They are just normal web applications or REST services using databases like PostgreSQL, using e.g. Spring Boot, Tomcat, etc. Maybe those libraries do things they're not supposed to, I don't know. I have never used sun.misc.Unsafe in my code or anything like that. Perhaps if I spent days studying the problem I could understand what was going on and what to do about it (although probably not, as the problems might have been in third-party dependencies.) But this wasn't money the companies I worked for wanted to spend. But anyway, my point is that spending days fixing stuff after an upgrade != backwards compatible.