5 ms·
A 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 cra
by StevePerkins 4y ago
A 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.
- tester756 4y ago>the underlying JDK is pretty inarguably one of the most solid and impressive pieces of tech ever developed. I agree, JVM is impressive.
- spaetzleesser 4y agoI think the first part of a standard lib is pretty straightforward to design. String operations, math, standard protocols, I/O are petty well understood. It gets more tricky once you get to higher levels abstraction like UI.
- makapuf 4y agoNio and streams API show that even those were not evident from the beginning of java.
- imoverclocked 4y ago> ... pretty straightforward to design. String operations ... Tell that to Haskell. Also, I've seen some pretty gnarly use of String in Java.
- Communitivity 4y agoI think much of the maligning Java gets is either due to people looking at badly written Java (2k LOC classes, factories of factories of factories, 15 arg methods, import * everywhere, etc.), or claims in error because they are not based on modern Java (claiming bad parallelism a la Hensen, citing a lack of modules, noting no functional support). I think Java is a good language if your problem space is ok with the GC and some other quirks. The problem space I've been in has issues with GC, so C++ or Rust are the main choices there (Go too, but not my preference).
- ComputerGuru 4y agoJava has long been crippled beyond the regular GC limitations by lack of value types, but that’s finally, finally going away.
- dboreham 4y agoExplains why there are no production Java applications...
- programmer_dude 4y agoFTFY... Explains why there are no high performance production Java applications...
- abraxas 4y agoYeah, other than Kafka, Spark, Cassandra, Flink, Hadoop, Elasticsearch what has Java ever done for us!
- reverend_gonzo 4y agoGiven there are hft firms built on Java…
- StevePerkins 4y agoI read comments like this all the time on HN and Reddit. But it's hard for me to separate real professional experience at day jobs, from hobbyist wishful thinking in personal side projects. All I know is that I attend a lot of Java conferences and meetups, and I'm STILL waiting to encounter a flesh-and-blood human in real life whose employer really wavers between Java and Rust. That's like choosing between a Humvee and a submarine, their optimal problem spaces barely overlap.
- Someone 4y ago> A typical well-designed class will usually be a few hundred lines of code, tops. Often less than 100 lines. It’s not the lines that take time; it’s getting the code to the “well-designed” state, double so (if not more) for an API.