Live data from Hacker News

Don’t call it a comeback: Java is still champ

github.com

521–530 of 557 posts

Re: Don’t call it a comeback: Java is still champ

#521
post #288
post #255

Earlier quoted context omitted.

The developers of apache httpd, nginx, postgresql, redis, among many others?

you really dont need redis if you have java. I see zero reasons to offload my datastructures via TCP, instead of have them locally. If need be, replicated them.

How do you share data between machines without something like redis?

Re: Don’t call it a comeback: Java is still champ

#522
post #64

Earlier quoted context omitted.

> but I think it'll slowly move the way of COBOL and FORTRAN That could be true of any language that's achieved great popularity, but in 2022 Java is the language that dominates server-side development (by plurality, not majority), it is a technological leader in areas of compilation, garbage collection, and low-overhead in-production profiling, no other single language looks posed to seriously challenges Java's domi…

> no other single language looks posed to seriously challenges Java's dominant position on the server (as PHP seemed for a while) What do you think about JavaScript in this context? JavaScript seems at least as popular among today's full-stack web developers as PHP was 15-20 years ago. V8 might not be as optimal a runtime environment for servers as HotSpot, but that won't necessarily diminish the language's popularit…

JavaScript is very popular overall, possibly more than Java, and it is, without a doubt, the dominant client-side language, but its prospects on the server are currently not as rosy as they were five years ago. It's never materialised as a solid, responsible choice for big, important, server-side applications, and it's lost the coolness factor it had when Node was young.

The market is much more fragmented than it was in, say, 2004, and so Java is not likely to regain its anomalous overwhelming dominance it had back then anytime soon, but no other language seems posed to do that, either.

Re: Don’t call it a comeback: Java is still champ

#523
post #512
post #508

Earlier quoted context omitted.

It was the @Query annotation which finally killed Spring for me. So I have to stuff all my SQL into an annotation now if I want raw JDBC? Madness. **ck that.

Why would you have to do that? You can just inject an entitymanager to wherever you want to use it natively and do whatever you want.

"inject an entitymanager"?? I don't even have any entities, just a db I want to query with raw sql.

Re: Don’t call it a comeback: Java is still champ

#524
post #288

Earlier quoted context omitted.

you really dont need redis if you have java. I see zero reasons to offload my datastructures via TCP, instead of have them locally. If need be, replicated them.

How do you share data between machines without something like redis?

well, trivially - really. Machines can communicate via TCP and UDP, pretty much the same way you communicate with a web server - but more efficiently (than http). There are tons of protocols/frameworks for replicated and distributed maps which are significantly more effective than redis, esp when hitting the local one.

Writing one such yourself, is sort of, rite of passage.

While redis is well understood and (relatively) easy to use - it's just a TCP offloaded map (and few other datastructures), all well implemented and with non-blocking IO but nothing groundbreaking. Heck, it's even single threaded by design - no vertical scaling, and no L3 cache communication.

Re: Don’t call it a comeback: Java is still champ

#525

Earlier quoted context omitted.

I believe it's unfortunate people judge the JVM ecosystem by Java. Scala and Kotlin are so much more attractive options if you write code for a living. Between this and the devolution from maven to gradle it's not a surprise junior developers are JVM-shy. I see companies downshifting to unmaintainable toys such as Python even in data engineering circles. It's really odd that mobile developers with Kotlin (and front-e…

Out of curiosity, what issues do you see with gradle given your statement about it compared to maven?

Maven is declarative. Once you know how to build and deploy one repository you can do it in any other. Including projects started a decade ago. Five commands is all you need to use it. It's trivial to have a monorepo with the classical 3-tier pom file structure.

It takes a 2/3-of-your-screen plugin configuration to build a Scala project. And you can simply copy that configuration without even thinking about it to another service.

I believe that making the "" declaration a one-liner would fix 80% of what's wrong with maven :)

Every single Gradle project I have worked with has its own structure. Which happens even across repositories owned by the same team. There are DSL flavors (Groovy and Kotlin), both are actually used and differ slightly. The wrapper. Its storage is based on Ivy, not Maven so you double the number of Internet replicas on your HDD. But it's still better than SBT ;)

Re: Don’t call it a comeback: Java is still champ

#526
post #425

Earlier quoted context omitted.

It's hard to see how C# will ever find wide usage outside of the MS ecosystem. It's so intrinsically tried to MS.

.Net 6 runs on Linux with, for example, PostgreSQL so how is that tied to M$?

By ownership? MS has chosen to let .NET run on platforms not owned by MS, but they are still controlling product direction.

Re: Don’t call it a comeback: Java is still champ

#527

Java was actually not bad for me in class when learning software design and data structures, but soul-crushing to work with in the real world. Mindless, unnecessary use of getters/setters, interfaces, and AbstractFactoryImpls. Hiding almost every piece of functionality behind 10+ layers of indirection. Dependency Injection with Spring. They all make it feel like Java draws folks who actually __enjoy__ writing bloated…

Java has reached the status of Cobol - it is immortal because it is everywhere and has been around a long time. Because of that, there are a lot of Java devs. Our team works in Go, and so we get a few Java devs in once in a while as new positions open up. The biggest change for them is to get out of archonaut mode and stop overdesigning everything. After going through a 3-6 month cleanse, it's fun to see them complai…

Modern java (check this - https://www.infoq.com/articles/data-oriented-programming-jav...) is really not that bad. Golang is like far more verbose than even JDK 8 (9 old release) for most parts. The issue is, many java users have only experience with spring ecosystem for doing most of the stuffs. There are far better alternatives in java ecosystem. There are other JVM languages like Kotlin with provides 100% interop with the ecosystems and is far better language than go.

Re: Don’t call it a comeback: Java is still champ

#528
post #457

Earlier quoted context omitted.

Why write many lines of validation when one line can suffice? @Entity class User { @NotBlank String username; } // Use site public User addUser(@Valid User user) { ... } as opposed to class User { String username; public void validate() throws ValidationException { if (username.isBlank()) throw new ValidationException("username is empty"); } } // Use site public User addUser(User user) { user.validate(); // ... }

I was thinking more about @RequestParam validation eg. fun calc1(@RequestParam @NotNull @Size(max=10) @Pattern(regexp = "^\\d{4}-\\d{1,2}-\\d{1,2}$") date:String, @RequestParam @NotNull @Size(max=5) @Pattern(regexp = "^\\d{2}:\\d{2}$") time:String, @RequestParam @NotNull @Size(max=40) @Pattern(regexp = "^[-_'A-Za-z/\\d]{2,50}$") zone:String, ): Map { Why stuff everything in the param list? No other framework I can th…

Sure, but nothing is stopping you from writing a `validate()` method right? It also appears to me that having so many validations for a base type `String` is indicative that there should be a `Date`, `Time`, and `Zone` type respectively for each of the arguments.

Re: Don’t call it a comeback: Java is still champ

#529
post #17
post #6

Being taught intro Java in high school (mid 2000s for me) was excruciatingly boring and caused me to write off majoring in computer science or working as a programmer. Today I'm a software engineer with experience in JavaScript, Ruby, Python, Elixir... maybe it's time for me to give Java another try.

It's not. Java has slightly improved since that time, for sure, but you're not missing anything.

Significant performance improvements, several new GCs, stream API, type inference, records, pattern matching, switch expressions, lambdas, default interface methods, 6 month release cadence, try-with-resources, GraalVM, many new APIs (like `java.time`), JFR open sourced, virtual threads (in preview), value types (in the works), improved native interop/FFI (in the works), etc. are more than just a "slight improvement".

Re: Don’t call it a comeback: Java is still champ

#530
post #423

Earlier quoted context omitted.

There is an interesting presentation titled death of optimizing compilers, where it is claimed that programs increasingly are either in their hot path where performance is absolutely crucial and not even C/C++ is sufficiently low-level (you can achieve 2-3 orders of magnitude faster code by hand-optimized assembly), or on cold paths where even Bash would suffice. Nonetheless, I found that it is easy to find these hot…

I would love to see a video game implemented in Bash with the hottest spots implemented in Assembly, just to see how poorly that would perform. I work for a company that has AWS Lambdas which are invoked 10s of trillions of times per year, with about 45% of that happening in a single month, and another 45% happening 6 months later, also within a single month. I cannot imagine what our AWS bill would be like if those…

I'm curious about the cost of hosting if you're using plain ol' VMs instead of lambdas (EC2, etc.). What are those functions written in? Unless you're going to say C/C++/Rust or a similar language, I'm not sure there will be any significant variance.
Post reply on HN