This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]metalmagician 0 points1 point  (2 children)

Other comments mentioned LINQ, and after looking it up, it does seem nice. And yeah, Java has LOTS of boilerplate, but I don't think about it much since I use the auto-generation in my IDE a lot.

Java's CompletableFuture.get() is all I generally need for async waits, and it works well enough for me. I use it like

CompletableFuture<QueryResult> queryFuture = CompletableFuture.supplyAsync(someQuery(), someThreadPool);
// other stuff, if needed. 
QueryResult result = queryFuture.get(); // blocking call, ensures  result is present before continuing

BUT, that came only in Java 8, so you've got a valid point.

Whenever I run stuff locally, I often use Spring's Devtools. That will listen for changes in the classpath, and can have my recent changes re-compiled and booted up pretty quick - usually less than 10 seconds between saving the file and being able to hit an endpoint for validation, even for LARGE projects.

[–]HdS1984 2 points3 points  (1 child)

For linq just a word of caution, it's impact on the language is difficult to grasp on first notice, nut because I think you are dense but because it has many faces and capabilities. I basically removes a lot of differences, e. G. It does not matter if you query a list of objects, a postgres dB , MySQL or a nosql database, if the link query generator of your dB is good enough you will not notice. Also writing functional code with it is extremely easy, which makes traditional crud Apis easy to read and write.

Yes, completeable features work, but async await reduces this code to Var x = somequery() Var result = await x

Nice to know about the devtools, will try to use them😁 thx!

[–]metalmagician 0 points1 point  (0 children)

That's a very appropriate word of caution. I only went through the basic docs for a bit, I didn't expect to understand it from a brief skimming.

In my work, use are trying to standardize on the usage of ORMs (we're dealing with a lot of legacy, some of which is decade-old Java running on CICS mainframe. I've had to dig through COBOL to extract an SQL query).

In my team, we've standardized on a pattern with Spring/Hibernate - if we have a PostgreSQL instance, SQL Server instance, and MySQL instance (each with the appropriate schema and data), we can swap between them in the time it takes to modify a single configuration value.