News for hackers. Stuff that matters.
Re:The complete guide to working with strings in modern Java... by Ciantic on Tuesday April 13, 2021 @11:38AM (#26793796)
Only thing useful I can come up is monkey patching without changing the function signature. E.g. smuggling additional data to a function which expects a string like thing.

But I think the whole `new String` is problematic, because it breaks the strict comparison:

  let a = "Foo";
  let b = new String("Foo");
  a === "Foo"
  true
  b === "Foo"
  false
Re:The complete guide to working with strings in modern Java... by mgerullis on Tuesday April 13, 2021 @12:25PM (#26794756)
> Only thing useful I can come up is monkey patching without changing the function signature. E.g. smuggling additional data to a function which expects a string like thing.

Yeah this sounds terrifying to me, if I were to debug something like this.

Also the fact they identify as objects:

    typeof new String("Foo") === 'object';
Case closed, I will never use it :D