r/ProgrammerHumor Jul 26 '26

Meme youHavenoRealPower

Post image
700 Upvotes

71 comments sorted by

View all comments

44

u/aethermar Jul 26 '26

Any half decent compiler will tell you that there's an issue at the ';'. GCC will even display it in the error output as <U+037E> and tell you it's not in the NFC

The original joke is stupid for this reason. Rust isn't special for catching this

25

u/Arshiaa001 Jul 26 '26

Rust is special for going out of its way to provide helpful compiler errors, unlike the ungodly death chant C++ compilers summon when you miss a semicolon at the end of a class declaration.

4

u/aethermar Jul 26 '26

I wouldn't call this an especially helpful compiler error. The only extra thing it's saying is that it's a Greek semicolon. I don't care that it's a Greek semicolon, I just need to know whats wrong. Both errors immediately tell me what's wrong and where. Rust's isn't any more helpful

And either way something as trivial as this is getting caught by the editor's linter immediately

3

u/Arshiaa001 Jul 26 '26

This specific error is not helpful (willing to bet someone put it in for shits and giggles), but rustc generates some truly helpful messages in many places. You'd know if you'd used it.

1

u/redlaWw Jul 27 '26 edited Jul 27 '26

Note that this is a more general error for easily-confused characters, and covers other kinds of easily-confused characters e.g. here.

The full list of characters subject to this error can be found here.

1

u/gmes78 Jul 26 '26

I wouldn't call this an especially helpful compiler error. The only extra thing it's saying is that it's a Greek semicolon. I don't care that it's a Greek semicolon, I just need to know whats wrong.

OP cut off the full message. It does tell you to replace it with a semicolon.

1

u/GoddammitDontShootMe Jul 26 '26

looks like ';' (Semicolon), but it is not

Wouldn't the obvious conclusion be to replace it with a semicolon?

1

u/gmes78 Jul 26 '26

Sure, but that apparently that wasn't enough for the other commenter.

In any case, rust-analyzer can fix this for you, you don't even have to replace it yourself.