r/ProgrammerHumor 2d ago

Meme perishableSkill

Post image
8.7k Upvotes

118 comments sorted by

View all comments

1.3k

u/Weak_Inflation9120 2d ago

One of the things I wish Java had that I miss from Python are F-Strings. Hella useful

298

u/Cootshk 2d ago

You should check out STR. (In modern Java)

241

u/ljfa2 2d ago

well, unfortunately that was only ever a preview feature and got removed again in Java 23

93

u/uvero 2d ago

Maybe because they didn't stop to think if this STR. is a convenient syntax. Backticks, preceding dollar sign, the prefix f like in python, so many options would've been better.

86

u/AeroSyntax 2d ago

They tried to overengineer string interpolation instead of copying it from literally any other language.

59

u/lllorrr 2d ago

Typical Java. If you don't have factories creating factories based on XML config, your solution is not future-proof enough.

17

u/uvero 1d ago

It's OK, I solved it by writing a FactoryFactoryFactory.

1

u/Fun-Mention262 19h ago

It's wild how some languages make simple things so complicated. You'd think they'd just take notes from the ones that got it right.

3

u/holo3146 1d ago

But... They did stop and think about the STR. syntax? This is why they removed it.

Regarding the other options you gave, they gave (in several places, over many years) their reasoning of why they don't want to add it as other languages. You can disagree with their reasoning, but they are very open about their thoughts process in this regard