4 ms·
> @NotNull/@Nullable is not part of the standard lib, but is a de facto standard nonetheless. Which one is the standard, the dormant JSR-305, the IntelliJ anno
by The_Colonel 4y ago
> @NotNull/@Nullable is not part of the standard lib, but is a de facto standard nonetheless.
Which one is the standard, the dormant JSR-305, the IntelliJ annotations or the checker framework (I guess that's the best candidate since it was actually accepted)?
> I found that defaulting to everything non-nullable (there is a setting in these tools which should be the default, implicit nullable or non-nullable)
Does this have a good cross-IDE support?
> gives you effectively the same null safety as Kotlin
"effectively", just ergonomically way worse.
But the main issue I have with this is that it requires you to actively seek null safety, pick a particular "standard" and push it through, ruthlessly enforce it during a code review. Which mostly doesn't happen. I've never seen a large codebase (which I would work on) which would use such annotations consistently. Yet unsurprisingly, all Kotlin code bases I've seen were in fact null safe.
- kaba0 4y ago> Which one is the standard, the dormant JSR-305, the IntelliJ annotations or the checker framework (I guess that's the best candidate since it was actually accepted)? Hence “de facto”. All of these tools understand all of them. And I do have to agree with your last paragraph, it is not as good as native support, but nor is it as big of a pain point as it used to be/as some people think it still is.
- The_Colonel 4y ago> but nor is it as big of a pain point as it used to be/as some people think it still is. It's a big enough pain point that I resigned myself on null-safety in existing Java projects. I rarely have the opportunity to start projects from scratch, and for those I'd rather use Kotlin.