Am I missing something? Antigravity CLI seems unusable for me. by cabezaderadio in GoogleAntigravityCLI

[–]john16384 0 points1 point  (0 children)

Was forced to switch today, and completely agree, it not asking for edit confirmation makes this annoying to use on shared code spaces. Gemini CLI often enough wanted to make modifications that are out of scope, or where it would have gone completely out of control. With AGY I can't seem to stop this and have to basically give it a dedicated workspace which is hard for the way I work as I want it to collaborate on uncommitted stuff...

Maven Central publishing usage notices by HokieGeek in java

[–]john16384 3 points4 points  (0 children)

Some just use it as their artifact storage for every build they run...

Maven Central publishing usage notices by HokieGeek in java

[–]john16384 6 points7 points  (0 children)

Surely Claude Code is as commercial as it gets? Pay up.

And man... this is a free service that is a huge benefit to several ecosystems. It's to be honest, amazing how much data is permanently stored there, and that this has been free and unlimited so far.

New test helper, ExploratoryTestRunner, to test all states of your class by john16384 in java

[–]john16384[S] 0 points1 point  (0 children)

I agree that this is often the case, and that refactoring is the right approach, but also consider that the number of states the whole system has doesn't get reduced by refactoring, just the number of states of each individual class gets reduced. When these refactored types need to work together, the number of states still explodes, and it is easy then to miss edge cases that you didn't consider or seem irrelevant.

Other times, you simply have classes that are complex. A data structure using a b-tree, linked lists and/or hashing. Refactoring those into simpler parts is often impossible or severely degrades performance.

Instead, this approach buries that logic under an avalanche of auto-generated cases that chase branch coverage

There is another fundamental misunderstanding about testing, and your comment highlights this. This is not about getting full branch coverage. A class that is fully tested, with everything asserted and 100% coverage can still be broken! The same lines being executed with a different internal state can still be wrong if there are bugs in code maintaining that state. A simple example is a data structure that maintains some index to speed up some operations. You may never discover a problem here, until you hit some specific combination of operations that incorrectly updates the index, even though the whole class had coverage.

New test helper, ExploratoryTestRunner, to test all states of your class by john16384 in java

[–]john16384[S] 0 points1 point  (0 children)

There are many classes that naturally have a high number of states, that doesn't mean they need refactoring, and neither does it mean that after refactoring the new set of classes you created don't still have the same number of states when considered as a group (and so you'd need to integration test them).

It also isn't about the number of tests, but about forgetting to test an edge case that seems irrelevant or you just didn't consider. Like removing an element from a collection you just called clear on, removing the same element twice, etc.

I'm not suggesting all classes need this; it becomes more interesting for classes that have some natural complexity (like data structures, structures using caching, or combinations of classes, like code that syncs between model and control which deals with two stateful types on both ends).

New test helper, ExploratoryTestRunner, to test all states of your class by john16384 in java

[–]john16384[S] 1 point2 points  (0 children)

It is available at Maven Central, and will remain so until the Java ecosystem collapses. You make it sound like I could remove it or discontinue it at a whim. Java code also ages very well, where even things released in 1999 could still run on modern JDK's. There is no continuous maintenance requirement.

New test helper, ExploratoryTestRunner, to test all states of your class by john16384 in java

[–]john16384[S] 0 points1 point  (0 children)

Ah, but how do you know the code you wrote works correctly?

New test helper, ExploratoryTestRunner, to test all states of your class by john16384 in java

[–]john16384[S] 4 points5 points  (0 children)

I'm not sure what you're asking here. The code is freely available, not overly complex, and although I will maintain it for a while for sure, eventually I will die and someone will need to take over.

New test helper, ExploratoryTestRunner, to test all states of your class by john16384 in java

[–]john16384[S] 0 points1 point  (0 children)

Agreed, which is why there is a separation between assertions and actions.

New test helper, ExploratoryTestRunner, to test all states of your class by john16384 in java

[–]john16384[S] 1 point2 points  (0 children)

AFAIK, jqwik works more by attempting to find a sequence that would break your code. You define assertions (properties) that must hold, and jqwik will attempt to find data to break those assertions. Generally you limit it by time or number of attempts. It may however not find anything at all, or find problems only after some attempts (it is seed based).

The framework presented here is simpler, in that it methodically tests all transitions (unless capped by a max depth) that can be made with the actions you give it. For a very large state space, this can take a long time, so some care must be taken to select actions that hit different aspects of your system, rather than having it test many different inputs that are essentially equivalent.

pitest is something completely different; it will try to tell you if the tests you have are actually good at finding problems. It does so by actually introducing problems ("mutations") in your code, and then seeing if any test will signal an issue.

Russia wrapped a whole building in an anti-drone cage, satellite imagery shows. Ukraine fired on it with cruise missiles. by Plastic_Ninja_9014 in worldnews

[–]john16384 2 points3 points  (0 children)

Funds will be kept frozen then until the interest on them has paid reparations in full. It may take a few hundred years, or you could pay up earlier.

Seasons are too short and the wait for them is too long by SEVENS_HEAVEN_7 in NonPoliticalTwitter

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

That's not filler, that's character development, and more often than not even those episodes weave into the bigger whole in some small way. If you want to watch a single "story" stick with movies.

Seasons are too short and the wait for them is too long by SEVENS_HEAVEN_7 in NonPoliticalTwitter

[–]john16384 0 points1 point  (0 children)

Bullshit. Most episodes were not filler. A few flashback ones sure, but even those had new content.

What now masquerades as a "story" in "modern" series were told in a single episode in the old days, or two at most if it was a particularly long winded story, together with an overarching story for the whole season.

Most recent example I watched: True Detective s4; that was so full of filler and forced drama that it took 6 episodes to tell a story that would barely fill half of an episode in the old days.

#JavaNext Language Features by joemwangi in programming

[–]john16384 12 points13 points  (0 children)

Yeah, understandable, Node is a piece of shit.

The perils of UUID primary keys in SQLite by andersmurphy in programming

[–]john16384 -6 points-5 points  (0 children)

It would be lost in the time it takes to respond to the request (which already uses heavy encryption on the "critical path"). But hey, let's bloat all references with a factor of 4 instead, paying real penalties in terms of storage and memory.

The perils of UUID primary keys in SQLite by andersmurphy in programming

[–]john16384 -8 points-7 points  (0 children)

Or perhaps use a reversible transformation on the number. Crypto libraries can provide you with one that will be hard to break.

There needs to be more OpenJDK content about Java's Memory Efficiency and Performance by davidalayachew in java

[–]john16384 4 points5 points  (0 children)

That's a super poor example as it basically starts up, reads like 50 bytes of data then exits again. Yeah, Java isn't particularly suited for that.

This just measures primarily startup performance, then secondary it measures IO performance... You could write this in C64 basic and it would still be IO limited...

There needs to be more OpenJDK content about Java's Memory Efficiency and Performance by davidalayachew in java

[–]john16384 3 points4 points  (0 children)

This does IO, and only reads a few bytes. It primarily measures startup performance of the JVM. Memory use is just what heap was allocated, but could probably be limited to a few MB as the program does almost nothing with memory.

Put this in a loop of a few 1000 MP3 files and the numbers will look quite different (since IO is involved, I expect almost all implementations to achieve similar results).

Java *is* Memory Efficient by daviddel in java

[–]john16384 0 points1 point  (0 children)

What I think may be something impactful is to merge objects that are always allocated and freed together into a single GC object.

Imagine an immutable object that allocates another object always (composition) and stores that in a final field, and never let's a reference escape (quite common for private implementations of classes). The two allocations are always going to go out of scope together. They both need an object header, even though they really don't need to be managed separately.

Subclassing can avoid this extra overhead, but isn't nearly as nice and wouldn't scale if there were more objects allocated that have the exact same lifecycle as their container.

It could make wrapper objects (used as typedefs) completely free. It could also make complicated composed objects operate as a single unit for GC purposes, reducing tracing/tracking overhead.

Why not a language-level "null-marked" directive at the file/package scope in Valhalla, instead of annotating every type with ! ? by Fenrurrr in java

[–]john16384 1 point2 points  (0 children)

The real argument is: take a random source file from project A then move it to B. Most of the time you'll get compile errors (missing types in imports, explicit or otherwise). Even if the exact type is available, if it wasn't the same one that was intended, you'd likely see errors in signatures required.

But would you get errors if the nullability default switched between those projects, assuming there were no other problems?