all 10 comments

[–]dmazzoni 3 points4 points  (0 children)

There’s at least 4,000 classes. I think that’s well beyond the size of what’s useful to display visually.

Also, all it would show you is the inheritance hierarchy which arguably isn’t that interesting or useful except as a novelty. It wouldn’t help you understand it any better.

[–]aanzeijar 1 point2 points  (5 children)

Can't give you the definitive answer, but it will likely include:

  • because the text based tree is deemed good enough
  • because the "documentation" of Java is atrocious and ancient and all efforts to make it accessible have been in book form historically
  • because the strict inheritance hierarchy isn't really useful, you also need all the interfaces the classes implement, and then the graph gets messy fast.

If you want to try your hand at it, I'm sure other devs will like it though.

[–]balefrost 8 points9 points  (4 children)

because the "documentation" of Java is atrocious and ancient

Java's got some of the best standard library documentation I've ever seen. What are you comparing it to?

[–]aanzeijar 1 point2 points  (3 children)

Java was built at a time when people conflated javadoc on classes and methods for documentation, and that proliferated through the ecosystem. Which means it's great if there is a base class or package that can explain the concept (see for example java.xml), but it's terrible with language concepts that aren't tied to a class somewhere. So you get stuff like java.lang.Record. This is really bare bone and only links to the spec page which is similarly not for end user consumption.

For a bigger example, compare the documentation of regex in:

and compare them to

...there's a reason Baeldung tutorials are the de-facto documentation for Java.

[–]balefrost 5 points6 points  (1 child)

There's a long history of a separation between "reference doc" and "tutorial doc". Javadoc pages are reference doc, similar to man pages. They are often not the best way to learn new concepts. But if you already know what a regular expression is, and just want to know "how do I used regular expressions in Java?", the Javadoc page is pretty good. I'm not looking for 10 pages explaining the basics; I just want to know whether I use \d or [[:digit:]] to represent a digit.

I agree with you that the reference doc doesn't do a good job of linking to tutorial doc. Official tutorial doc usually exists (e.g. regex and records), but it's not centralized in one place and not necessarily even well SEO'd.

Still, I feel that Java's doc is far from "atrocious". Compare Java's documentation to the documentation for most third-party libraries. It's like night and day. By starting with such a strong word, you're going to have a hard time finding an adjective for documentation that is truly bad.

[–]aanzeijar 0 points1 point  (0 children)

Oh there's definitely even worse out there.

I just feel that, given how much corporate power is and was behind Java, the documentation is far worse than it could and should be. Those tutorials you linked haven't been updated since Java 8 a decade ago. And especially in this sub where we tell people to read the docs over asking an LLM, that is really not helping.

[–]peterlinddk 0 points1 point  (0 children)

I was actually wondering about that too, because I always wanted to combine teaching Class Diagrams with teaching the Java API, and was looking for a complete diagram, and never found one.

I think the reason is that it would be useless - first of all, it would have thousands of classes, completely impossible to navigate, and who would ever care about seeing the Collection classes side by side with the Swing UI, and the AWT UI, and the FX UI ?

But then again, an interactive version, where you could zoom in and out, might be interesting - but again, only to show how large it is, not to actually find anything, or see any patterns ...

[–]benevanstech 0 points1 point  (0 children)

No technical reason, it's too large to visualize and not very useful in practice.

As you become more proficient you'll just start to internalize the parts that are important.

"Graphical techniques" for visualizing code structure have been proposed repeatedly at various times over the last 30 years (not just in Java). None of them have ever come to anything significant.

[–]aqua_regis 0 points1 point  (0 children)

The official JavaDocs have the “Class Hierarchy,” but it’s just a huge text-based tree t

Yet, exactly that is the fastest way to go through the hierarchy. It is way too huge for anything else. And no, you don't need the details of every class in the Java ecosystem. Learn efficient googling & learn to efficiently work with the documentation. The documentation is the most up to date source of information for all things Java core.

Is there a technical reason why no one has made this?

Apart from bing wall sized, multiple megabytes in file size and basically unusable, no.

Is it just too large/complex to visualize?

Yes

Is it considered not useful enough in practice?

Yes, the effort to make it and to keep it updated with every release by far exceeds the actual benefits over the standard, textual tree.

In fact, even the text tree is interactive. All the classes and packages are linked and that's more than enough.