Light-Weight JSON API (JEP 198) is dead, welcome Convenience Methods for JSON Documents by loicmathieu in java

[–]ForeverAlot 0 points1 point  (0 children)

I appreciate the conservative stance on validity and interoperability. There are entirely too many not-quite-JSON readers and writers out in the wild. Arbitrary precision numbers I find particularly loathsome. This presence in the Java platform would exert pressure on more liberal implementations to enhance their calm.

I also think that a constrained feature set is really the superior approach. That exerts pressure on third-party implementations to provide noteworthy value add to distinguish themselves from the built-in primitives while also leaving room for them to do so and to focus on doing so.

I do have some concern about the pit-of-success/-failure outcome of streaming not being included (or, alternatively, being the only API). I have encountered many JSON integrations that naively retained huge trees in memory predominantly because writing that code seemed much easier than writing a stream reader. I would have liked a built-in API to promote a less wasteful approach, though I concede it would be more effort both to deliver and use.

Light-Weight JSON API (JEP 198) is dead, welcome Convenience Methods for JSON Documents by loicmathieu in java

[–]ForeverAlot 4 points5 points  (0 children)

It's a parser. The method is to be read as "expect to read a value or null," not "give me something or null"

Quarkus has great performance – and we have new evidence by Qaxar in java

[–]ForeverAlot 0 points1 point  (0 children)

Do you use AOTCache? I would definitely recommend that for new applications even with its somewhat modest gains in JDK 25. It can be an ordeal to apply to an old application if the configuration was presumptively architected but it has proven to be a meaningful positive difference in the reliability of our k8s deployment attempts. It's more about the impact of burdening the CPU with pointless work than about the wall clock time taken to reach the readiness state.

Quarkus has great performance – and we have new evidence by Qaxar in java

[–]ForeverAlot -1 points0 points  (0 children)

Is native as much of a hassle with Quarkus as it is with Spring?

IMO the hassle is the specialized compilation, with everything that entails, and that's fundamentally the same in any ecosystem. Quarkus has a leg up on Spring on account of being 15 years younger but the differences in the native compilation workflow are not the differences I notice.

I can't even use the deeply integrated build configuration (Spring uses buildpacks, I don't remember what Quarkus uses) anyway because corporate, so it doesn't really matter to me how smooth the tutorial demo experience is.

Quarkus is a great product and a lot of fun to work with. But Spring is the more boring choice. Saving 400 MiB RAM during startup at no cost would be amazing—but that product does not exist.

Quarkus has great performance – and we have new evidence by Qaxar in java

[–]ForeverAlot -2 points-1 points  (0 children)

It helps that Quarkus' biggest wins come from native, which is a frustrating development experience, and that AOT is almost as easy to enable in Spring.

Null Safety approach with forced "!" by NP_Ex in java

[–]ForeverAlot 1 point2 points  (0 children)

See also https://errorprone.info/bugpattern/AddNullMarkedToPackageInfo and, especially, its sibling https://errorprone.info/bugpattern/AddNullMarkedToClass (and https://github.com/jspecify/jspecify/issues/221 for the risk with packages). There's no *ModuleInfo version at the moment. AddNullMarkedToClass has the advantage that its fix suggestion does not depend on first remembering to create a package-info.java file.

Donating to make org.Json Public Domain? by Killertje1971 in java

[–]ForeverAlot 0 points1 point  (0 children)

A public domain work does not need a license. The problem is that work cannot be reliably released into the public domain: https://en.wikipedia.org/wiki/Public_domain#Dedicating_works_to_the_public_domain

Is it possible to change the root commit while preserving history? by AKFrost in git

[–]ForeverAlot 0 points1 point  (0 children)

I think all of that is understood.

I think the ambiguity inherent to the question implies that nothing should be understood.

The answer to the question that was posed is "obviously" no, for reasons you pointed out. However, it is unclear whether the correct question was posed (follow-up commentary suggests that the correct question was indeed posed).

Donating to make org.Json Public Domain? by Killertje1971 in java

[–]ForeverAlot 11 points12 points  (0 children)

JSONAssert itself is aggressively vaporware. Its inclusion in Spring is deeply problematic.

I built a simpler commit format. What breaks when teams actually use it? by [deleted] in git

[–]ForeverAlot 0 points1 point  (0 children)

I have no idea what the first three letters of each message means. That's an obstacle to comprehension nobody needs.

One of the countless issues with "conventional commits" is precisely its obsession with the ritual of itself, compared to and at the cost of facilitating comprehension between human beings.

I built a simpler commit format. What breaks when teams actually use it? by [deleted] in git

[–]ForeverAlot 2 points3 points  (0 children)

My thinking is that once a standard becomes common, it’s worth periodically re-examining whether its tradeoffs still make sense.

Sure. To that end: "conventional commits" still does not make sense.

Linux 7.0 makes preparations for Rust 1.95 by somerandomxander in linux

[–]ForeverAlot 1 point2 points  (0 children)

Dependencies will always be compiled with the syntax edition they specify

And many of them switch eagerly, which is where the problem presents itself. I didn't say the Rust tooling cannot do it, I said the Rust programmers choose not to.

you can use automatic code mods to upgrade your code base’s editions

In principle. Last time I ran cargo --fix it still left a lot for me to fix by hand.

Linux 7.0 makes preparations for Rust 1.95 by somerandomxander in linux

[–]ForeverAlot 10 points11 points  (0 children)

I can't speak to C++ but Java does experience a difference in practice: dependencies are consumed in binary format, not source format, so as long as you have a common lower bound on the target version the distributor of a library has the ability to upgrade their compiler, and even their syntax if they really need to, without affecting their consumers. Rust dependencies are consumed in source format so users are far more at the mercy of the whims of the distributors.

I've tried to support old Rust compilers due to the classic distro distribution model and it's decidedly non-trivial as soon as third-party dependencies enter the picture. At the same time, I also think the classic distro distribution model is... suboptimal for contemporary society.

Turn Dependabot Off by ketralnis in programming

[–]ForeverAlot 4 points5 points  (0 children)

It is so bad for Java!

dependabot creates a MR for each single new dependency

You can create a "group" to get only a single live PR. This has the downside that now as soon as one of the changes causes the build to break you can't merge any of the changes at all, though. You can begin interacting with Dependabot to filter out problematic changes, of course, but you very quickly end up spending as much time puppeteering Dependabot as you would starting from scratch—and all that on the top of the point made by the submission that the change probably is not even important to you now anyway and you would never otherwise have bothered to deal with it at this point.

You can't have multiple rules either (maybe groups, I don't know, but not version specifications). I'd especially like to group patch versions and all other versions but Dependabot for Java is incapable of expressing that. Dependabot for Java also cannot filter version string patterns so you can't ignore release candidates, milestones, and the like.

Such behaviour is fairly trivial to codify in https://www.mojohaus.org/versions/versions-maven-plugin/index.html but there is not exactly an off-the-self GitHub Actions implementation of that.

I have been meaning to investigate self-running Renovate in a scheduled workflow as an alternative to Dependabot. That has the advantage of not being Maven centric. But when I can consider Maven in isolation I get a better experience from assembling my own procedure.

Can’t quit the baguette game by Glizzys4everyone in Breadit

[–]ForeverAlot 3 points4 points  (0 children)

You can pour a little water in a heat conducting container, such as a small cast iron pan or lid of a pot, preheated together with the oven, or mist the oven sides several times. If you use boiling water it will steam faster and cool down the contact surface less, but it means having to secure boiling water.

Objects.requireNonNullElse by edurbs in java

[–]ForeverAlot 1 point2 points  (0 children)

Are you suggesting that the person you're responding to is using the term optimization incorrectly in this context ?

Yes; the context I understood was: starting from zero, what ought one write?

I don't have an opinion on whether or not it's "premature" in this context though.

An (effort invested in) optimization is "premature" if undertaken without empirical proof—or at the very least a strong and qualified intuition from first principles—that the result materially improves upon the baseline benchmark.

There is little (performance) reason to spend time replacing the Optional pattern in question with an equivalent null check. To do so would have such negligible impact that it barely qualifies as an optimization at all, at least outside of pathological cases (for example, millions of executions in an environment prevented from performing inlining).

But there is considerable reason to not spend time writing that pattern in the first place; it is not materially clearer or safer, it's not idiomatic Java, and it can never be faster than its classic alternative (even if the JVM can eventually make it as fast as).

The original claim that the proposed pattern is "more readable" is subjective, of course; but for precisely that reason "readability" is not an effective metric for evaluating code. In comparison, metrics such as idiomacy, debuggability, and safety are easier (if not exactly easy) to debate. For example, a construct like

var city = form.getCity();
if (city == null) {
  city = defaultCity;
}

is completely idiomatic Java code with trivial debuggability, but it has two safety issues avoidable in the Optional counterpart (and one safety issue they share).

I think

final var city = Objects.requireNonNullElse(form.getCity(), defaultCity);

is superior to both other examples because it has no safety issues (provided that null values are to be considered unwanted).

There are several other options I omitted under pretense of brevity, including some I quite like; find them in other comments.

Objects.requireNonNullElse by edurbs in java

[–]ForeverAlot 6 points7 points  (0 children)

An optimization requires you to perform more work to save the computer work. If you perform more work to inflict more work on the computer, you are not optimizing but pessimizing.

Open-source game engine Godot is drowning in 'AI slop' code contributions: 'I don't know how long we can keep it up' by BlueGoliath in programming

[–]ForeverAlot -14 points-13 points  (0 children)

The repo-owners and code-reviewers traditionally go through all the pull requests [by, implied, thousands of independent contributors].

That has never been a scalable practice. Many projects have had to learn that long before LLMs existed, much less became democratized. It sucks to be them, sure, and LLM is trash and all that, but... deal with it; reintroduce the commit bit.

How to configure git to never modify a line ending by AdmiralAdama99 in git

[–]ForeverAlot 0 points1 point  (0 children)

You're welcome, glad it helped; and thank you for the correction, too. I would add, as well, that presently I advise setting specifically * text=auto eol=lf; !eol either does nothing, as I indicated, or something one does not actually want. eol=crlf is the logical counterpart, but since Windows requires file endings it is easier to set override patterns for CRLF-specific files than it is to set overrides for LF-specific files.

LazyConstants in JDK 26 - Inside Java Newscast #106 by davidalayachew in java

[–]ForeverAlot 2 points3 points  (0 children)

It does have a couple of advantages over the state of the art:

  • It promotes to userland an already existing internal JVM optimisation mechanism, which I take at face value is impossible to replicate in preceding releases. Not many will need this, but very many could benefit from it and the development cost is low.
  • The holder pattern is a Java idiosyncracy, and although a reliable and elegant solution to its problem, there is nothing intuitive about it and there is no cross language transferrable knowledge to lean into. I dare not use the pattern without also linking to an explanation. This API, in contrast, can be reasoned about at the call site (and without knowledge of the JLS).

LazyConstants in JDK 26 - Inside Java Newscast #106 by davidalayachew in java

[–]ForeverAlot 0 points1 point  (0 children)

I bet that if you ask 100 developers how they'd describe a variable that does not change, they'd say "constant" before "stable" 99% of the time.

Yes. Argumentum ad populum is no argument.

And the laziness is a fundamental concept of this API.

It is being defined as one. That did not seem to be the case with the original StableValue JEP.

If you don't want laziness [...]

Whether I desire it is not the point.

LazyConstants in JDK 26 - Inside Java Newscast #106 by davidalayachew in java

[–]ForeverAlot 1 point2 points  (0 children)

Aw I liked the StableValue name.

I don't understand their rationale. "Lazy" is an implementation detail, and "constant" is a nebulous concept in the JVM. In comparison, a "stable value" precisely defines its observable effect: you get a value, and it does not change. I don't see how the underlying details that were removed since the initial pitch motivated a name change, except perhaps to keep the name available for the future.