this post was submitted on 15 Sep 2023
413 points (84.4% liked)

Programmer Humor

23710 readers
1767 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
all 32 comments
sorted by: hot top controversial new old
[–] BradleyUffner@lemmy.world 50 points 2 years ago (2 children)

Any remotely capable IDE will immediately show you what, and where, the problem is.

[–] stebo02@sopuli.xyz 12 points 2 years ago (1 children)

it would still be confusing why all semicolons are highlighted

[–] qaz@lemmy.world 2 points 2 years ago

VSCode has a special case for this

[–] etler@programming.dev 1 points 2 years ago (2 children)

That means that detection was added explicitly because this prank was done enough that it was worth it to add.

[–] Quik 1 points 2 years ago

The reason is in fact not only because of this exact symbol, but because people tried to change program’s behavior in a malicious way by replacing legitimate code with same looking symbols.

[–] dylanTheDeveloper@lemmy.world 1 points 2 years ago

We do a little trolling

[–] NegativeLookBehind@kbin.social 28 points 2 years ago (2 children)

Something similar happened to me a while back. I was copying some code from a Mac to a remote Linux host. For some reason the Mac was using a thing called an “en dash” which is slightly longer than a regular hyphen - and was really fucking frustrating to figure out.

[–] AlexWIWA@lemmy.ml 2 points 2 years ago (1 children)

Ah, my favorite character. I abuse the hell out of the em-dash.

[–] psud@aussie.zone 1 points 2 years ago

For someone who abuses it, there is a remarkable absence of em-dashes in your comment :—)

[–] lobut@lemmy.ca 2 points 2 years ago (2 children)

Some mac apps have some quirks, the default note app was probably not meant for pasting code in, but when you do it changes the quotes and makes them all fancy. Drives me up the wall and there's nobody to blame but me.

[–] NegativeLookBehind@kbin.social 6 points 2 years ago

I blame Steve Jobs.

[–] jadedwench@lemmy.world 2 points 2 years ago

I was looking for this. Some text from webpages end up pasting that way too, even on non-mac systems, and it is utterly infuriating. Nothing I hate more than having to paste something into notepad++ so I can fix all the stupid quotes from some online tutorial that is giving you things to paste into a command prompt.

[–] Anticorp@lemmy.ml 16 points 2 years ago (2 children)

I knew a guy who used the Unicode character for a space in his password. He figured if anyone ever saw his password they'd think it was a space and still not be able to use it. It's silly, but it was a fun thing to learn about him.

[–] bc001@programming.dev 2 points 2 years ago (1 children)

Which character. Does it need Combination of keys or a Single key.

[–] Anticorp@lemmy.ml 1 points 2 years ago (1 children)

A combination of keys. I don't remember the code anymore.

[–] quinkin@lemmy.world 2 points 2 years ago (1 children)

Alt-255 was the old-school method.

[–] Cow_says_moo@lemmy.world 2 points 2 years ago

I use alt 0160 for a non-line breaking space.

[–] shasta@lemm.ee 1 points 2 years ago (1 children)

That's pretty neat, but also means he will never be able to log into things on mobile

[–] elint@programming.dev 4 points 2 years ago

Bitwarden has no problem filling passwords containing unicode characters on Andorid.

[–] python@programming.dev 10 points 2 years ago (1 children)

ESLint has entered the room

[–] MeatsOfRage@lemmynsfw.com 9 points 2 years ago

Or any coding software really. Does this guys friend code in notepad?

[–] drew_belloc@programming.dev 8 points 2 years ago

If the language doesn't force me to use semicolons i will forget

[–] Boxman@lemmy.world 6 points 2 years ago* (last edited 2 years ago) (1 children)

Me who programs in rust which has a specific compiler message to tell me what happened

[–] Hawk@lemmy.dbzer0.com 1 points 2 years ago
[–] itsraining@lemmy.world 6 points 2 years ago* (last edited 2 years ago) (2 children)

Technically I don't think any Greek layout uses a different Unicode codepoint for the question mark. In fact, the ordinary semicolon symbol is used, so what the meme describes would probably not happen IRL.

Does all this make it any less funnier? No. It's still brilliant.

[–] luciferofastora@lemmy.zip 11 points 2 years ago (1 children)

In Unicode, it is separately encoded as U+037E ; GREEK QUESTION MARK, but the similarity is so great that the code point is normalised to U+003B ; SEMICOLON, making the marks identical in practice.

Source: https://en.wikipedia.org/wiki/Question_mark

I'm still curious whether it would be accepted by the code interpreters / compilers of various languages. I'm not bold enough to assume they all normalise properly.

[–] itsraining@lemmy.world 5 points 2 years ago

Wow, thank you, didn't know of that.

[–] nxfsi@lemmy.world 7 points 2 years ago (1 children)

Unicode should have enforced the principle of using the same encoding for similar looking characters like they did with CJK instead of allowing bullshit like the Cyrillic "o" or the Greek question mark.

[–] yum13241@lemm.ee 1 points 2 years ago

1,000% percent.

[–] tfw_no_toiletpaper@feddit.de 2 points 2 years ago

I don't even know what to say to this one.

[–] darcy@sh.itjust.works 1 points 2 years ago

any modern compiler or ide will notice this and warn you.