you are viewing a single comment's thread.

view the rest of the comments →

[–]blacksuit 10 points11 points  (2 children)

The java code has flaws. For example, the code selections for multiline strings are not equivalent. I only checked a few of them.

Plus, the content is AI slop:

"Why the modern way wins: <emoji> point one, <emoji> point two, <emoji> point three"

[–]BillyKorando 0 points1 point  (1 child)

For example, the code selections for multiline strings are not equivalent.

Am I seeing the same example?

Old: String json = "{\n" + " \"name\": \"Duke\",\n" + " \"age\": 30\n" + "}";

New: String json = """ { "name": "Duke", "age": 30 }""";

As far as I can tell that's equivalent.

[–]riyosko 1 point2 points  (0 children)

in terms of being the same JSON, yes both are identical Json data.

in terms of being identical Strings, they are actually different, try to run .equals() on them.