Re:Java 20: A Sneak Peek on the Panama FFM API
by narrator on Wednesday December 07, 2022 @07:27PM
(#33902427)
You will need to use an IDE to be productive in Java. One thing that Java does better than just about any other language though is it's maintainable. A codebase in Java can exist for decades and not become unmaintainable no matter what lowest bidder IT services contractor works on it. That's because the language makes it hard to write obfuscated spaghetti code and the static typing allows for deterministic refactoring of bad code. That's something you can't easily do in JavaScript.
[ Parent
| on HN ]
Re:Java 20: A Sneak Peek on the Panama FFM API
by AlphaSite on Wednesday December 07, 2022 @10:46PM
(#33903911)
I don’t know if this is true, I’ve seen some truly awful spaghetti g with a dozen modules to implement a trivial web api and it was indecipherable. This was for a “tech” company as well, not just some random internal app (it was built by the sales org though, which explains it).
Re:Java 20: A Sneak Peek on the Panama FFM API
by kaba0 on Thursday December 08, 2022 @01:51AM
(#33905012)
Everything can be done, but I do believe it is empirically true that Java programs has “long shelf lives”.
Re:Java 20: A Sneak Peek on the Panama FFM API
by throwaway2037 on Wednesday December 07, 2022 @10:41PM
(#33903878)
This is an interesting comment. When you say "maintainable", I would agree but for different reasons. It would say a single owner for most of the ecosystem (Sun->Oracle) makes it exceedingly stable. (Yes, I know IBM has a parallel universe, but little used compared to Oracle's.) Think about it: A single vendor provides the whole stack: compiler, debugger (including remote!), standard library (immense, well-documented), virtual machine, and IDE (NetBeans). There is also a small army of well-paid, highly skilled developers employed by Sun->Oracle constantly working to improve this ecosystem. Probably, the only thing they don't provide is a build system. They originally wrote Ant, but then let free in the wild. Also, no segmentation faults, full exception stack traces, and mature decompilation tools make it incredibly simple to debug -- even the hairiest legacy libraries. With the exception of Microsoft's C#/.NET, I cannot think of any mature equivalent. Note: Above, I never mentioned the open source community (Maven Central Repo, etc.). I won't touch that because the quality varies wildly.
And, yes, I agree 100% about your reference to low cost developers. From an enterprise view, it is cheap and easy to find (low quality and) low cost developers to maintain legacy Java software.
You also wrote: <<... static typing allows for deterministic refactoring of bad code. That's something you can't easily do in JavaScript.>> Most JavaScript devs would immediately reply: "Oh, use TypeScript for that." As I understand, you can incrementally upgrade a legacy JavaScript project to TypeScript, then slowly add types. Also, I have refactored lots of Java code that uses Object as a substitute for C's void*. That type of code is so difficult to understand without a debugger. Also, very difficult to refactor due to limited typing.
Re:Java 20: A Sneak Peek on the Panama FFM API
by kaba0 on Thursday December 08, 2022 @01:49AM
(#33905003)
I’m not sure I agree with the single owner part — it surely helps to give that “final touch” stability, but Java’s huge advantage is being an actual standard with an insane number of very independent implementations. Sure, most actual code will run on basically OpenJDK with minor modifications, but features are not added willy-nilly and the semantics are not just “whatever our single compiler outputs”.