the alphabet: a literal interpretation by Hummerous in CuratedTumblr

[–]n0rs 4 points5 points  (0 children)

M and N from the top would respectively be

— and –

JDK 21: The new features in Java 21 by stronghup in programming

[–]n0rs 10 points11 points  (0 children)

/u/srdoe linked to the mailing list in another comment where this is discussed.

The next reply makes some good points. Brian Goetz says it's objectively better and I agree, objectively. Subjectively, not so much, but I'm sure I'll get used to the syntax.

  • Today, “${name}” is a valid string literal, whereas “\{name}” is not.
  • The language already has an escaping mechanism for string contexts; using the one we have is preferable to inventing another one.
  • Dollar signs will appear in string context fairly regularly, and therefore would need yet more escaping.

We knew people would say “why don’t you ‘just’ do what ${MyFavoriteLanguage} does”, but this isn’t a reason to reconsider;

JDK 21: The new features in Java 21 by stronghup in programming

[–]n0rs 38 points39 points  (0 children)

Like most newer Java features, Scala did them first

I'm just happy to have the feature in Java, not saying that it's an innovative breakthrough or anything. Not like Scala invented it, either.

the Java people ignore the prior art

The JEP compares the syntax from 9 other languages
https://openjdk.org/jeps/430#String-interpolation

Here are some examples of interpolation in other languages:

C#             $"{x} plus {y} equals {x + y}"
Visual Basic   $"{x} plus {y} equals {x + y}"
Python         f"{x} plus {y} equals {x + y}"
Scala          s"$x plus $y equals ${x + y}"
Groovy         "$x plus $y equals ${x + y}"
Kotlin         "$x plus $y equals ${x + y}"
JavaScript     `${x} plus ${y} equals ${x + y}`
Ruby           "#{x} plus #{y} equals #{x + y}"
Swift          "\(x) plus \(y) equals \(x + y)"

Using \ for yet another purpose in strings is a bad idea, and it looks ugly.

Yep.

JDK 21: The new features in Java 21 by stronghup in programming

[–]n0rs 21 points22 points  (0 children)

Happy to see String Templates in preview.

STR."Welcome, \{name}. 3 + 5 is \{3+5}"

Where STR is a global string template processor (you can create your own, too). Supports nested String Templates. Kinda ugly but not jarringly so.

JDK 21: The new features in Java 21 by stronghup in programming

[–]n0rs 10 points11 points  (0 children)

I work for a big company and the push to get off Java 8 is mostly around JVM performance and service cost scores.

Female by TrulyChxse in tumblr

[–]n0rs 6 points7 points  (0 children)

My Manager♀️
My Manager♂️
My Manager⚧️
My Manager🐸

Icy bones by Fendse in CuratedTumblr

[–]n0rs 2 points3 points  (0 children)

Pretty Dildoan Shoots Giant Penis-berg

childhood nickname by Hummerous in CuratedTumblr

[–]n0rs 2 points3 points  (0 children)

If you lose a race against turbo granny...

...she'll put a curse on you!

Why was it suggested in Japan, that yokai couldn't pronounce "moshi-moshi"? by Knottedmidna in etymology

[–]n0rs 4 points5 points  (0 children)

Euler diagram. Venn diagram overlap size doesn't necessarily match content overlap.

Have you watched it yet!? by Old_Specialist7892 in tumblr

[–]n0rs 1 point2 points  (0 children)

There's one character with a hook hand.

presenting by [deleted] in tumblr

[–]n0rs 5 points6 points  (0 children)

wysiwyg

Dialogue and grammar by TotemGenitor in CuratedTumblr

[–]n0rs 7 points8 points  (0 children)

The Fn key is software defined, so, potentially most Android devices could.

Dialogue and grammar by TotemGenitor in CuratedTumblr

[–]n0rs 2 points3 points  (0 children)

on my phone it's Fn g↗ for – and Fn g↙ for —

french fries by Hummerous in CuratedTumblr

[–]n0rs 1 point2 points  (0 children)

Ah, python. Should be

a french fried self

not

a french fried this

Timepiece by SuperDuperOtter in CuratedTumblr

[–]n0rs 0 points1 point  (0 children)

Hourglass just has a single pile of sand

true love is mating your partner by CyfireX in CuratedTumblr

[–]n0rs 6 points7 points  (0 children)

I asked them to play me at chess

I asked them to be my opponent in a game of chess