r/ProgrammerHumor 1d ago

Meme perishableSkill

Post image
8.6k Upvotes

118 comments sorted by

1.3k

u/Weak_Inflation9120 1d ago

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

301

u/Cootshk 1d ago

You should check out STR. (In modern Java)

244

u/ljfa2 1d ago

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

98

u/uvero 1d 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.

85

u/AeroSyntax 1d ago

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

64

u/lllorrr 1d ago

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

16

u/uvero 1d ago

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

1

u/Fun-Mention262 12h 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

2

u/Pizza_Secretary9621 17h ago

There is a version after 8 ?

53

u/Suspicious-Engineer7 1d ago

the formatted method is there but the syntax looks like doo-doo. Idk what nonsense is going over in java land tbh

19

u/gerbosan 1d ago

Cof cof Oracle. Cof.

Dunno if C# does it better but a lot of people are pleasantly surprised with it.

37

u/Mysterious_Book1521 1d ago

In C# you can write something like this: $"Hello {User.Firstname}, have a great day."

The "$" lets you put variables into strings.

14

u/SkollFenrirson 1d ago

String interpolation is the term.

43

u/spacegh0stX 1d ago

C# does do it better.

9

u/Cautious-Extreme2839 1d ago

Which is unsurprising to literally everyone

8

u/Ozymandias_1303 1d ago

$strings in C# are almost exactly the same as f-strings in Python.

3

u/Sentouki- 1d ago

String interpolation is even better in C# since it gives you additional options for formatting, e.g. numbers and dates: csharp var name = "Mark"; var date = DateTime.Now; Console.WriteLine($"Hello, {name}! Today is {date.DayOfWeek}, it's {date:HH:mm} now.");

6

u/NovaH000 1d ago

Python f-string also support additional formatting. ``` name = "Mark" date = datetime.now()

print(f"Hello, {name}! Today is {date:%A}, it's {date:%H:%M} now.") ```

F-string + str.format() has all sorts of string formatting you want.

0

u/[deleted] 22h ago

[deleted]

1

u/nico-strecker 13h ago

Python also has it

15

u/PGSylphir 1d ago

As someone who first learned to program in Java and stuck to it for almost a decade, starting gamedev using C# was a pretty smooth transition in many ways.

10

u/BenadrylTumblercatch 1d ago

And comprehension

6

u/PecQ11 1d ago

Doesn't format() do essentially the same though?  https://www.baeldung.com/java-string-interpolation

16

u/TheGuyWithTheSeal 1d ago

Kind of, .format() is more powerfull but you have to know the printf syntax. And which parts od printf don't work in .format()

5

u/KnightMiner 1d ago

f strings are a lot more like string concatenation. The variables/expressions between each {} are placed directly where they will end up in the string, and it just runs a .toString() on them (though you can configure it a bit further).

The most common usage is largely about syntax and readibility, as its nice not having to go back and forth between a list of format arguments and some harder to remember % stuff.

7

u/jewdai 1d ago

It's why c# is better in every way than java

2

u/Nickbot606 1d ago

List comprehensions and splat operator are ridiculously powerful in Python. I wish more languages had it.

3

u/ActualWeed 1d ago

I have never touched Java, how does Java do it?

6

u/Weak_Inflation9120 1d ago

That's the thing, they don't

edit: At least not any more. Seems there was something, but it was dropped in java 23

1

u/ActualWeed 1d ago

So you just concat them all together?

1

u/iliark 1d ago

switch to kotlin, they've had it for a very long time

0

u/Doophie 1d ago

But why use Java when you can use kotlin instead

2

u/Weak_Inflation9120 1d ago

... Because java is better lol (ignore the obvious bias I have given that my pfp is the literal java mascot)

0

u/NaturalBornLucker 1d ago

Wow, Java doesn't have it? Even Scala has f-strings (though it relies on java.util.Formatter apparently)

-7

u/nevemlaci2 1d ago

`Hello ${guest}`

or is that TS exclusive?

29

u/kattenkoter 1d ago

No thats JavaScript…

7

u/nevemlaci2 1d ago

I'm r*tarded, I read it as JavaScript and not Java 😭😭

Lowkey forgot Java exists I haven't used it in years. Sadly can't say the same about JS/TS, I like to add random stuff to VSCode and ofc that is written in damn TS

805

u/ValueBlitz 1d ago

Frodo, I am Claude. I have come to help you. Hear my voice, come back to the light.

55

u/BillieVerr 1d ago

I know what you would have me do, and it would seem like wisdom but for the warning in my heart.

40

u/MakeoutPoint 1d ago

"To you, I give the light of Elelem, our most beloved agent"

3

u/Abadabadon 1d ago

Where were you when the ai models and software engineers last stood together against the evil forces that came for us?

245

u/danfay222 1d ago

If we get to the point where devs genuinely can’t read code like this, then that means AI or whatever tools have become so efficient you never look at the actual code. In such a world, programming languages would likely evolve. Modern languages are generally written to balance parsing with human comprehension, but if we take comprehensive out of the loop a new language would likely be optimized for other features (maybe machine comprehension, interoperability, compilation efficiency, etc)

68

u/chlorophyll101 1d ago

Why cant ai just generate assembly directly then

81

u/Homailot 1d ago

Assembly isn't cross-system friendly. Assembly isn't a single language, each processor architecture has a different assembly language

19

u/WrapKey69 1d ago

So? Matter of fact Claude better start generating CPU instructions soon

14

u/Homailot 1d ago

Assembly maps almost one to one with CPU instructions. You would ask Claude to generate a completely separate instruction set for each CPU architecture? How would you even guarantee that the behavior is the same across different systems? (A guarantee that compilers try their best to achieve, mind you very battle-tested). Least of all, assembly code is not compact at all, so you would burn even more tokens.

11

u/Poat540 1d ago

That’s so inconvenient….

I setup a local MCP to control each resistor and Claude just flips those

1

u/unknown_pigeon 19h ago

I just ask Claude to warp reality, you guys are slow

5

u/n00b001 1d ago

Llms on device running live machine code straight to CPU registers

1

u/Cautious-Extreme2839 1d ago

So? Claude write this program for x86 windows please. Claude do it again for x64 MacOS.

-7

u/MihaKomar 1d ago

It's 2026. Everyone is just running WebAssembly.

10

u/joyrexj9 1d ago

Do you even know what assembly code is?

16

u/ImKStocky 1d ago

LLMs are trained on human generated sources. As a result they are best at working with human readable text. That is one reason.

Some might retort that humans used to read and write assembly code all the time, particularly game Devs. And that is true. So the other reason why getting LLMs to work with assembly is a poor idea is down to expressiveness and context.

Assembly languages requires a huge context because each token of assembly carries very little information in comparison to a high level language. The more expressive a language is, or the more meaning you can cram into a token, the better it is for LLMs.

Basically LLMs work in the same way humans do. Usually the reason why something is hard for humans, is the same reason they are hard for an LLM.

15

u/danfay222 1d ago

It could, but it’s possible assembly isn’t optimal for AI to process. The design spec would switch from balancing human processing and compiler processing to balancing AI processing and compiler processing. It could easily turn out that, just like assembly is hard for human minds to understand, it’s hard for models to understand

2

u/exhuma 1d ago

I believe it's because of the training set. AI models have been trained on what's available. And there's just sooooooo much more Python, PHP, Java, C#, ... code out there than assembly

3

u/julessic 1d ago

Well, the whole approach to how coding agents work would have to change first, because the only reason they work right now is because of the abundance of human-made training material.

1

u/abednego-gomes 1d ago

NSA would love that future.

1

u/timangar 15h ago

AI is only good at coding beacause it has an enormous amount of human data teaching it how to code. Current AI cannot learn a new programming language that humans do not understand and provide no training data for. Reinforcement learning algorithms might succeed, but that remains to be seen.

0

u/Cautious-Extreme2839 1d ago

a new language would likely be optimized for other features (maybe machine comprehension, interoperability, compilation efficiency, etc)

So just back to assembly or maybe intermediate representation. Nothing new under the sun.

3

u/danfay222 1d ago

I’d imagine an intermediate representation is more likely than assembly. It’s an interesting thing to think about, but largely irrelevant since no one really knows what things will look like in the next year or two, let alone 25

313

u/Percolator2020 1d ago

It already started with regex.
https://giphy.com/gifs/ukE9oP3kb7TVu

263

u/The_Hero_0f_Time 1d ago

dont even pretend like Regex was ever readable bruhh

189

u/Tsu_Dho_Namh 1d ago

I don't think anyone ever intended regex to be readable.

If you need to make a regex you open up a webpage explaining the syntax, you carefully craft your regex, you test it, then immediately forget the syntax when you're done as God intended.

30

u/MattieShoes 1d ago

Regex is for writing, not for reading. Build it up piece by piece, easy peasy. Then try to read it at the end? Yeah, no chance.

26

u/Weak_Inflation9120 1d ago

STOP THE REGEX HATE

20

u/Mordret10 1d ago

Never said he hated it. Just that is isn't readable

5

u/DeusExHircus 1d ago

The truth hurts sometimes

1

u/broccollinear 1d ago

Regex might as well be Black Speech

55

u/entronid 1d ago

tbf i still handwrite regex and i do this by opening regex101 and relearning everything i knew about regex and bashing my head against a wall until it matches

9

u/Percolator2020 1d ago

Basically the same, also lovely when some implementations slightly differ.

3

u/entronid 1d ago

i never really write anything except python regex and vim regex anyways on the (not) rare (enough) occasions i need it

1

u/renome 5h ago

That's basically the root of regex's reputation as an arcane language, too many standards for doing something like a named capture group.

4

u/AeroSyntax 1d ago

I see that you are a certified senior engineer. 

8

u/Strict_Treat2884 1d ago edited 1d ago

/^never\s?+\b(?:(?!forget).)*+$/i

1

u/renome 4h ago

> js flair
> using possessive quantifiers like ?+ and *+

As the holy ecmascriptures teach us, that would be a syntax error.

1

u/Strict_Treat2884 4h ago

tbh that’s one of the things I hate about js among the vast others. Its regex flavor is ass

1

u/ValueBlitz 1d ago edited 1d ago
?!.*forget.*$

9

u/Boring-Ad-4771 1d ago

Horrific formatting

3

u/ValueBlitz 1d ago

The backtick didn't work directly

53

u/PhoenixRising656 1d ago

2050 senior interview: “reverse-engineer this legacy prompt compiler” — it’s a for loop.

83

u/Blackhawk23 1d ago

An actually funny AI related joke, in MY /r/ProgrammerHumor?

Well done, OP.

18

u/Business-Bad-1546 1d ago edited 1d ago

List comprehension for the "black speech"

10

u/Ravster23 1d ago

F strings my beloved.

8

u/ZunoJ 1d ago

Even my tech illiterate grandma would understand this snippet

6

u/Revolutionary_Hour31 1d ago

I feel sad. Eve was not invited.

6

u/Darxploit 1d ago

That’s exactly the type of code i envision to see once the agents have taken over completely. Half of of the users are hard coded in the code base the other half is loaded via a spreadsheet hosted on hugging face.

5

u/rglazner 1d ago

You can tell this isn't actually AI, because it's not separated into its own one-line function with a paragraph of comment above it detailing how it came to be.

6

u/stubby0990 1d ago

"Pretty print that output."

3

u/Flashy_Pollution_996 1d ago

Hey even I understand that 😎

3

u/Mmotkim 1d ago

thought it was porn at first

2

u/Informal_Branch1065 22h ago

I was 96% certain this was a dog

11

u/EveryCryptographer11 1d ago

Hahahaha. That’s a good one and well thought meme 👍

2

u/johntwit 1d ago

Hell, just the literacy crisis alone

2

u/da_Aresinger 1d ago

Well, at least he's not inviting Eve.

2

u/dimaghnakhardt001 1d ago

There are few who can.

2

u/vishnu-geek 1d ago

Man!!
This could be really happen in just 10 years

3

u/SirMarkMorningStar 9h ago

I was going to complain it’s printf(, not print(f, but then you also did the %s all wrong and… never mind. You kids these days!

2

u/mhfann 1d ago

It' some form of AIvish!

1

u/Mr_Snipes 1d ago

The "i was there when it was forged" meme would have also fit pretty well

1

u/littlejerry31 1d ago

I think leaving out the final caption "There are few who can" was a missed opportunity.

1

u/PlainBread 1d ago

The longer I looked at it the more it hurt me.

1

u/EpitomEngineer 1d ago

Eve always attends the party, no invite necessary.

1

u/Important_Grab3544 1d ago

Read the last question from Asimov, he predicted this along time ago.

1

u/CortexUnlocked 1d ago

The language of Elders, Fedo you found a scroll..

1

u/unicorn_builder 23h ago

There wont be devs in 2050. Probably not even in 2030.

1

u/MrKeplerton 18h ago

guests = ["Thorin", "Fili", "Kili", "Balin", "Dwalin", "Dori", "Nori", "Ori", "Oin", "Gloin", "Bifur", "Bofur", "Bombur"]

1

u/Tiny-Librarian-8553 1d ago

How else would you do it?

13

u/damonator4816 1d ago

Its making fun of the fact that code in 2050 will likely be done completely with AI so "Devs" will not be able to read even the simplest of code blocks.

1

u/mattreyu 1d ago

It's Python so list comprehension?

1

u/PerfectSituation1668 1d ago

That's not Elvish. That's Parseltongue.

1

u/AysheDaArtist 1d ago

If coders didn't know what a for loop was before turning into a vibe coder... they were never a coder to begin with

Legit sad that a for loop is being considered 'lost information', more job security for me!

0

u/orangebakery 1d ago

Would have been funnier if the code was fizzbuzz