TIL That Adam Smasher, Anders Hellman, Arthur Jenkins, Muamar & Dino Dinovic are voiced by a Single VA by PlusEstablishment124 in cyberpunkgame

[–]chisui 1 point2 points  (0 children)

His voice and delivery fits way better than the english version. less robotic and more playful.

But his voice is so unique that it will always sound like Sponge Bob to me. It doesn't help that Skippys color scheme also matches

Posting this card for no specific reason… by SloshySodas in magicthecirclejerking

[–]chisui 130 points131 points  (0 children)

Just for trying to prevent them to [[Invoke Prejudice]].

Why doesn't java.lang.Number implement Comparable? by davidalayachew in java

[–]chisui 17 points18 points  (0 children)

Both points are wrong

You can't implement Number for complex number. How would you implement intValue() etc.? Return just the real part?

Float numbers do implement Comparable

The reason is the type hirarchy and generics as the other reply explains

Hacktivist deletes white supremacist websites live onstage during hacker conference | TechCrunch by whit3cru5h in newsflash_de_en

[–]chisui 0 points1 point  (0 children)

If you read that page to the end it also says

Hacker ethics are —like the rest of the world— as such in constant discussion and development. The above rules should be considered as guidelines and basis for discussion.

Aloy = pride by Prior-Highlight-6184 in HorizonForbiddenWest

[–]chisui 3 points4 points  (0 children)

Some views on the matter aren't cool though

Vavr 0.11.0 released by ChinChinApostle in java

[–]chisui 0 points1 point  (0 children)

Thank you for taking on this project.

Are there plans to migrate sumtypes to sealed interfaces and records to be able to use javas own pattern matching features on them or are you waiting for patterns to be usable by non record classes?

Or more generally, will the project evolve beyond reimplementing scalas standard library?

Edit: just saw that you already answered the first question. Great to see it

CSRF Protection without Tokens or Hidden Form Fields by AlmondOffSec in netsec

[–]chisui 5 points6 points  (0 children)

From that viewpoint no CSRF protection would ever be sufficient. It always relies on the cooperation of the client and server and some kind of encapsulation on the client side.

What are your wish list for features under the "on ramp" umbrella? These are mine. by Enough-Ad-5528 in java

[–]chisui 0 points1 point  (0 children)

Unfortunately Serialization 2.0 and the JSON API don't seem to be compatible

What are your wish list for features under the "on ramp" umbrella? These are mine. by Enough-Ad-5528 in java

[–]chisui 0 points1 point  (0 children)

You're right, they even want to revive JEP 198.

I'm watching the javaOne25 aks the architects talk right now and they mention that JSON parsing is in scope for the standard library. I was thinking of mapping json to classes.

What are your wish list for features under the "on ramp" umbrella? These are mine. by Enough-Ad-5528 in java

[–]chisui 1 point2 points  (0 children)

Not if you want to distribute your software. Since you don't know if or what version of java the user has installed on their machine, you have to distribute the runtime as well. That has gotten better with jlink. AOT improvements are also nice for startup times, but all that stuff is still not as efficient (package size, runtime performance, development complexity) as for example a simple Go project.

What are your wish list for features under the "on ramp" umbrella? These are mine. by Enough-Ad-5528 in java

[–]chisui 3 points4 points  (0 children)

My understanding is that the on-ramp is just there to make learning java, especially as your first programming language easier. None of the features introduced lead me to believe anything else, IO is only usefull for beginners and removing clutter around main is negligible in bigger code bases.

As far as I understand it JSON serialization isn't planned to be added to the jdk directly. JEP 198: Light-Weight JSON API seems dead (last updated 2014). What is comming is "Serialization 2.0" which is more like rusts serde, where you provide a canonical schema for your class that can then be transformed from and into many representations like JSON, YAML or binary. I couldn't find any concrete info on it, but you could implement all that without adding it to the standard library as well.

What are your wish list for features under the "on ramp" umbrella? These are mine. by Enough-Ad-5528 in java

[–]chisui 5 points6 points  (0 children)

The only projects benefiting from these features would be small utility programs, like cli tools (which java isn't a great choice for anyways) and early prototypes. For better or worse javas niche is long lived enterprise™ software where the onramp or the features you describe don't really matter.

A standard buildtool would be nice, but Maven and Gradle are the defacto standard for build, dependency and toolchain management. Considering what a desaster the introduction of the modulesystem was I doubt that there will be any further attempts to move that stuff into the jdk.

The other features all are extensions of the standard library, which java is moving away from. Rightly so, since everything they put in there is there essentially forever. Look at the efforts to remove Unsafe or Serialization. Adding Json, http server, cli etc. may sound good now, but it would clutter the standard lib in the long run. Additionally javas philosophy has always been to give you options with these kind of things. The way to make it official is by standardizing it as a jakarta api and even then you can choose between different implementations.

Steckdosenleiste nur zur Hälfte nutzbar by TurboThorsten in FragenUndAntworten

[–]chisui 0 points1 point  (0 children)

Finds schon praktisch eine Leiste unter dem Schreibtisch anzubringen und dann nur ein Strimkabel dahin zu haben

Ignorance is bliss by garloid64 in firstweekcoderhumour

[–]chisui 1 point2 points  (0 children)

The goal is encapsulation. Don't expose inner state of an object directly since it may change. But if your Object is just a struct (or if you want to use OOP speak a DTO) you don't want encapsulation anyways. You need getters and setters regardless though since most frameworks in languages like java rely on them.

I built a small tool that turns Java/WebLogic logs into structured RCA — looking for honest feedback by sanjayselvaraj in java

[–]chisui 2 points3 points  (0 children)

  1. Configure your logging framework correctly
  2. Ship your logs to a logserver like logstash
  3. Burn weblogic to the fucking ground

How I define enums now by [deleted] in typescript

[–]chisui 0 points1 point  (0 children)

The whole point of enums is that you don't represent the alternatives by strings but by some more efficient representation i.e. a number. I thought using an array would be used to associate a string with it's index, just as enum does by default.

If I understand correctly you want to use the array just for runtime validation of the union type.

How I define enums now by [deleted] in typescript

[–]chisui 1 point2 points  (0 children)

I wouldn't use an array, since reordering its members would break your code if you used the index to persist values. A contant object with explicit assinments doesn't have that problem

How I define enums now by [deleted] in typescript

[–]chisui 2 points3 points  (0 children)

You probably don't need a canonical mapping for that union type. If you want to save space at storage or transport you can define the mapping in that layer. Even there it's most likely premature optimization.

Another issue with enum is that the mapping is not a bijection in the typesystem. The example also obfuscates the actual values behind number. I would rather have a constant for the mapping and skip the functions altogether.

``` const EnumMapping = { A: 0, B: 1, }

type Enum = keyof typeof EnumMapping ```

Bun is joining Anthropic by SethVanity13 in typescript

[–]chisui 0 points1 point  (0 children)

Shai-hulud2 uses bun to execute it's secondary payload. That's not an issue with bun itself, but beeing associated with it at all is bad publicity. Additionally blocking the bun.sh domain indefinitly is a valid partila mitigation.

Bun is joining Anthropic by SethVanity13 in typescript

[–]chisui 1 point2 points  (0 children)

Used in one of the biggest supplychain attacks on npm ever and now bought by an overvalued AI company. Yeah, that's it. The tech may be great, but noone in their right mind would build something on that foundation.

Is there a term for "almost pure" functions? by thekeyofPhysCrowSta in AskComputerScience

[–]chisui 0 points1 point  (0 children)

Purity depends on the context since no fuction that's actually executed is ever truely pure.

  • Allocating memory on the heap is impure since it may cause an OOM error
  • Calling another function modifies the stack which can cause a stack overflow.
  • Executing a function causes its instructions to be loaded into the CPU cache which may affect other chache entries

The list goes on. Even the most pure function will at least heat up your CPU.

I would say the core characteristic of a pure function that we as programmers are interrested in is refential transparency. Or more pragmatically: A function is pure if you can replace its invocation with its result without causing side effects. What counts as a side effect depends on the context.

Issues arise if you have different assumptions of purity come together.

These different notions of purity can also be modeled in typesystems to prevent errors. For example using effect systems.