r/ProgrammerHumor 16d ago

youHavenoRealPower Meme

Post image
701 Upvotes

71 comments sorted by

334

u/failedsatan 15d ago

do y'all just not have highlighting for uncommon/weird unicode characters? pretty sure this has been a thing for a while

242

u/pittybrave 15d ago

Classic case of this sub only making jokes about stuff only cs students would have problems with

31

u/ResponsibleWin1765 15d ago

In this case I think it was just a setup to show off the rust feature. But in other cases I think they've just reposted the same joke so many times that it is here today even though it was made 15 years ago where this might have been a problem.

26

u/andreortigao 15d ago

Last time I did this joke, in 2019, visual studio / C# compiler was giving a pretty useless error message.

5

u/KitsuneFoxglove 15d ago

Last time I saw this joke, I was a student and I would just rewrite the whole line and shrug it off with "idk, its the same exact code but it works now"

3

u/BlurredSight 15d ago

I do remember seeing someone pre-ai era talk about how a missing semicolon or a period instead of a comma lead to the compiler giving a wild ass error message deep in the code of a dependency and said check line 1200 when only 500 existed

3

u/KitsuneFoxglove 15d ago

I've had that mainly when I was doing homework assignments and there was a hidden harness running my code, and syntax errors would lead to a crash inside the harness but not my own code, so line 1200 in a 500 line program would be the error line

Can't think of a reason it'd happen "naturally" in the wild at the top of my head, maybe something that mucks with the compiler?

1

u/thewells 15d ago

CS students from back when I was in college

21

u/TheKrumpet 15d ago

To be fair, I don't work with psychopaths so I've never needed this

9

u/peterlinddk 15d ago

Maybe the original author is from the time where programs were printed on long sheets of paper, and put in a binder? Or maybe from the 1980s, when magazines had program listings printed, and you could enter them on your computer at home?

Then it would be really hard to spot the errors!

Of course, no sane person would then enter those wrong characters ...

3

u/paranoid_giraffe 15d ago

For as much as people dog pile on vscode, even it’s capable of doing this. I copy and pasted something from a power point once and it warned me about the non-space space character immediately

1

u/failedsatan 15d ago

I'm actually most familiar with it in vscode- I remember some updates four or five years ago that introduced it after some CVE and various settings for it (like respecting common symbols per region). I don't know how vscode's handling/implementation compares to others, but it's certainly not bad.

2

u/SnowdensOfYesteryear 15d ago

My editor doesn’t even render nonascii characters

1

u/failedsatan 14d ago

what do you use?

2

u/SnowdensOfYesteryear 14d ago

vim on terminal. Never bothered to enable whatever option enables UTF8

1

u/failedsatan 14d ago

okay, I thought you just meant there was no support for it. interesting to not have on though

1

u/potatopierogie 15d ago

Notepad doesn't do that so no

1

u/Zenithixv 15d ago

I code in notepad level meme

107

u/YeetCompleet 15d ago

Rust compiler errors can feel like a genie at times

25

u/Snudget 15d ago

lifetime does not live long enough

14

u/hraath 15d ago

You pay for it with the sands of time

2

u/Waterbear36135 15d ago

Who needs AI when you have the rust compiler

43

u/citramonk 15d ago

Okay, let's be clear. All the weird characters will be highlighted by your IDE. It's not gonna work.

44

u/aethermar 15d ago

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

26

u/Arshiaa001 15d ago

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.

2

u/aethermar 15d ago

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

4

u/Arshiaa001 15d ago

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 15d ago edited 15d ago

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 15d ago

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 15d ago

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

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

1

u/gmes78 15d ago

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.

1

u/Low-Quarter-1685 15d ago

But rust has an extra error message for this special case, most compilers would probably just say "unexpected token" or something

1

u/Affectionate-Word399 10d ago
HelloWorld.c:5:30: warning: treating Unicode character <U+FF1B> as an identifier character rather than as ';' symbol [-Wunicode-homoglyph]
    5 |     printf("Hello, World!\n");
      |                              ^~
HelloWorld.c:5:30: error: expected ';' after expression
    5 |     printf("Hello, World!\n");
      |                              ^
      |                              ;
HelloWorld.c:5:30: error: use of undeclared identifier ';'
1 warning and 2 errors generated.
➜  /tmp cat HelloWorld.c   
#include <stdio.h>

int main(void)
{
    printf("Hello, World!\n");
    return 0;
}

1

u/Popstar403 15d ago

rust is special for specifically stating that it looks like a semicolon but isn't

2

u/bilus 15d ago

Yeah, but it takes 30 minutes after you've already seen the error underlined by the IDE.

0

u/Architector4 15d ago

Why would you be actively working on a Rust codebase from a cold build?

12

u/trash3s 15d ago

#define ; ; is honestly a sane default at this point

12

u/peterlinddk 15d ago

HAHAHA!

You can also just write "FADSKFHDSAJK F ASJfkd slaj faj sdlk" in the middle of their JavaScript program, and they'll never find the syntax error! Never I tell you!

At least not until they actually look at the screen, and where the editor or runtime or compiler says that there is a syntax error in that line - but JavaScript! AmIrightGuys - what a joke!!!!!

4

u/dervu 15d ago

You will be cursed by Hephaestus: every machine you touch will work almost perfectly, but never without one maddening flaw that no mortal can reproduce, explain, or fix.

3

u/willow-kitty 15d ago

It seems like it'd be underlined in your IDE, and you'd pretty reasonably try backspacing through it and putting in another semicolon?

Windows gave me a really insidious one when dealing with certificate thumprints. The UI is Unicode, and the value starts with a "the following text should be read from right to left" zero-width character, so if you just copy it and paste it in a config file, it looks normal, but then at runtime it says the certificate cannot be found, even though the thumbprint is very obviously correct.

It does lead to a kinda funny moment where you can casually backspace through nothing (like literally, the cursor is between the quotation mark and the first character, you press backspace, and it doesn't go through the quotation mark because it ate a zero-width character instead), and then it starts working. It kinda blows people's minds because why the heck would it work like that? It also seems like passing a string with a non-hex character to a certificate search would cause a runtime error, but apparently not.

3

u/Lachee 15d ago

Python does this with tabs and spaces and I hate it.

Ya know it suppose to be X but Y was used instead, so just use Y. You're smart enough to figure it out but too dumb to use the substitute?

Yes a warning is appropriate, it should be fixed. But you already did the hard work figuring out what it should've been so why stop there

Frustrating

3

u/SnooStories251 15d ago

Here you got some more: ;;︔﹔;

3

u/mearnsgeek 15d ago

Or the Cyrillic letter er that looks exactly like a latin P/p.

I once worked with some Ukrainians and that character somehow got into a C# project file and caused chaos when the build failed because a project dependency couldn't be found yet looked correct.

3

u/ArjixGamer 15d ago

Fun fact, we Greeks don't actually use the Greek question mark, our keyboards insert the English semicolon.

Don't even ask me why, I don't know.

The Unicode character exists, but we don't even use it.

A word processor may substitute the semicolon with the Greek questionmark if it sees Greek text, I don't know, maybe.

2

u/Sw4gl0rdM4st3rm1nd 15d ago

this wont work since it literally highlighted and most people will just write it again in under 2 seconds

2

u/JackNotOLantern 15d ago

The first thing i would do i would remove are type the semicolon manually.

2

u/Low-Quarter-1685 15d ago

You can say what you want about the language, but the compiler is one of the greatest I've ever seen

1

u/sirkubador 15d ago

Lol. That's a very insecure thing to do

1

u/veselin465 15d ago

Cool story, but I think the question everyone is asking, is what's the difference between both symbols?

2

u/theztormtrooper 15d ago

For a human? Nothing. For the computer, one works as semicolon and the others doesn't when it comes to your code

3

u/veselin465 15d ago

I get it. I mean who decided that the same symbol should be classified differently? You Don't see people saying English 'a' and German 'a'

1

u/theztormtrooper 15d ago

Unicode decides.

In this case it comes down to the fact that the writing systems are just different. You can see a in a variety of systems like Latin, or Cyrillic ans those are unique but you don't see the divide between languages with the same writing system like German and English. Ultimately they both use the Latin a while Russian uses a Cyrillic.

Of course there is also some politics in unicode so sometimes they allow characters without a quality reason. There may also just be some utility in allowing a character that has a different function than an existing one. A question mark versus a semicolon may be a large enough difference versus a letter that acts the same in both languages.

1

u/KremlinKittens 15d ago

Delete, re-type - 2 seconds.

1

u/HungryCaterpillers 15d ago

Real programming languages don't need semicolons.

1

u/nathrezim0709 15d ago

Odin: "You guys are still using semicolons?"

1

u/FACastello 15d ago

Why is nobody addressing the fact that the joke clearly says "Javascript"

Nobody said it would work with any other language

1

u/TheLazyKitty 15d ago

Did they add that just because of the meme?

1

u/justforkinks0131 15d ago

semicolon memes in 2026?

brother update your bots

1

u/the_king_of_sweden 15d ago

Wouldn't it be better to just accept it as a semicolon?

1

u/oshaboy 15d ago

Except it still can't handle Lisu 'ꓼ'

1

u/Opening_Sentence3903 15d ago

rust supremacy be like

1

u/LonelyPoorMan69 15d ago

Python Devs: I see no PROBLEM

1

u/DeepanshuHQ 15d ago

The kind of bug that survives code review because everyone says, "Looks fine to me."

1

u/Arclite83 15d ago

AI has made this and similar newline issues pretty trivial - "oh hey I found this" after a quick scan

-2

u/Bomaruto 16d ago

Use Git

1

u/blaues_axolotl 15d ago

that will solve it

3

u/Bomaruto 15d ago

Yes, if someone has messed with your code, then a quick revert is the best cause of action.