6 ms·
You guys were creating Java? > ~1,000 classes in 1.1, ~10K in 1.2 the next year. 9K classes in a year sounds crazy as hell
by tester756 4y ago
You guys were creating Java?
> ~1,000 classes in 1.1, ~10K in 1.2 the next year.
9K classes in a year sounds crazy as hell
- Aperocky 4y agoSounds about right for Java..
- hot_gril 4y agoI disagree with what I call Java's OOP obsession, but I have to admire the drive behind that ecosystem.
- origin_path 4y agoHow many classes do you think it should have, ballpark, given the same feature set? GUI toolkits alone can produce thousands of classes because there are thousands of concepts that make sense to model, then add on security, collections, many utilities, XML handling, multiple RPC systems and so on. It's hard to over-state how large the Java standard library is. And it's not like other ecosystems do better. The standard complaint about JS is that you try to do something basic in that ecosystem and discover you have 10,000 modules in node_modules. Not so different, really, except that the Java stuff comes from a single team with a relatively coherent design philosophy.
- Aperocky 4y agoIf it is necessary to have that many classes, then there should be so many classes. but in Java everything is a class, main function? in a class. a library of static functions? in a class.
- mypalmike 4y agoSure, classes act as namespaces in that case. What pain point does it cause?
- origin_path 4y agoWith an alternative design you'd need to have some other code container concept, but it'd be almost exactly the same as a class file. If the JVM also had a separate notion of a non-class file, just hold to hold static methods, then it'd boil down to duplicating the format. Most languages decide to make the source file the first-class container concept, or in native languages, the DLL/.so, but this isn't obviously better and comes with its own downsides. Orienting the VM around classes has a bunch of upsides that contribute to Java being successful. The real complaint here is more about the syntax boilerplate involved in writing top level functions in Java that map to classes with static methods. Kotlin shows there's no deep reason why the Java language has to be written this way, it's just notation. They picked it to avoid complicating the language with special cases, but I can easily agree that smarter syntax is more important than the Java guys have historically believed. Kotlin is proving this at the moment.
- silisili 4y agoSounds like a typical enterprise Java hello world type application.
- georgemcbay 4y agoDoes the AbstractFactoryFactoryInterface and AbstractFactoryFactoryImpl count as two different classes...? Kidding aside, I always found Java as a core language (and the basic standard library for it) to be mostly fine, but the weird architecture astronaut cult that hovered around it and infected many of the commonly used libraries to be a real problem. Maybe things are different now for the language, I haven't touched it in many years at this point.
- ngc248 4y agoYeah it was never the language or the core libs which were the problem, it was mostly some of the frameworks which had the FactoryFactory problem
- StevePerkins 4y agoA typical well-designed class will usually be a few hundred lines of code, tops. Often less than 100 lines. 9k classes * 100-300 == 900k-2.7m LOC Not TOO crazy for the most complete standard library ever developed, for a language meant from the beginning to take over enterprise business computing. How many LOC are in whatever meme language is hype this year? Hell, I feel like I see nearly that many lines of console output, when I run NPM to pull in dependencies, lol.
- zeusk 4y agoComplete maybe, but it was not fun learning or using swing in college.
- killjoywashere 4y agoThis is the kind of comment I come to HN for. That's a powerful insight on work estimation.
- tester756 4y agoThat's 36 classes per *day* (900/250 workdays) I don't know how many people were working on that but when developing standard library you do not really want to rush designs. You want to be very, very careful about it. Here's a book about it from one of the most experienced people in API/Standard lib design on the planet https://www.amazon.com/Framework-Design-Guidelines-Conventions-Addison-Wesley/dp/0135896460 https://www.amazon.com/Framework-Design-Guidelines-Conventio...
- StevePerkins 4y agoI can't speak for grandparent commenter. However, I can point out that the standard library for Java 17 has a TOTAL of 4,388 classes. TODAY. A quarter-century after the timeframe that they're talking about: https://docs.oracle.com/en/java/javase/17/docs/api/allclasses-index.html https://docs.oracle.com/en/java/javase/17/docs/api/allclasse... So if ~10k classes were really written in a year, then I can only assume that most of that was the compiler or virtual machine runtime (i.e. C++ code) rather than the standard library Java code. Regardless of how anyone feels about "verbosity" or "design patterns" in Java application code, the underlying JDK is pretty inarguably one of the most solid and impressive pieces of tech ever developed. I'm not throwing any rocks at that codebase.
- layer8 4y agoCreating new classes is easy. Keeping the number down while still restricting them to a well-defined responsibility each is actually hard.
- adastra22 4y agoThe 90’s were a weird time.