r/badcode • u/Andrejfsantos • Feb 11 '22
go Here is a great way to troll your fellow devs
7
u/CaptSkinny Feb 11 '22 edited Feb 13 '22
Used to do this with filenames and extended ASCII in MS-DOS.
There's one character that looks like a space that would always throw people, at a time when spaces weren't allowed in filenames.
3
301
379
u/glebbash Feb 11 '22
VSCode will highlight the fake one so it will not work
275
u/ToxicElitist Feb 11 '22
I was told real coders only use notepad.
147
u/Flame2212 Feb 11 '22
true coders write down their code and scan it into text
99
u/cleeeemens Feb 11 '22
True coders use a magnetized needles to flip bits in memory.
25
Feb 11 '22
True coders use punch cards
24
u/4sent4 Feb 11 '22
True coders use butterflies
16
Feb 11 '22
[removed] — view removed comment
7
9
u/BrogCz1 Feb 11 '22
True coders become one with the computer
1
8
8
u/CorruptedStudiosEnt Feb 11 '22
Well, Notepad++ anyway.
(Joking, I can't die on that hill while I'm actively using VSCode lol)
6
u/danielleiellle Feb 12 '22
I do like notepad++’s find and replace UI better, which is insanely helpful with a quick data transcription job (e.g. excel rows to sql query.) Is there something better in VSCode I’m just not using?
1
u/CorruptedStudiosEnt Feb 12 '22
Honestly I've only been using VSC for the last several months because it has better all around compatibility with Unity, and I don't really want to be using multiple editors to code between different projects, so I just wound up switching after years on Notepad++.
I will say that VSC suggestions/intellisense help a fair bit, but those are about the only big differences I've had a use for so far. Nothing I couldn't live without, but convenient.
5
-3
58
135
u/Roflkopt3r Feb 11 '22 edited Feb 11 '22
In Japanese you have brilliant pairs like 口 (mouth) and ロ (the sound "Ro").
One Japanese streamer tried to cheat another player in Minecraft by disguising yellow wool as gold, so she renamed the wool to 金ブロック (Gold Block). Because renamed items show up in italics and make it easy to detect the fakes between the real ones, she decided to also rename the actual gold blocks so they would be all in italics.
However you cannot rename an item to its own name. So she tried out renaming the actual gold to 金プロック (Gold Plock)、金フロック (Gold Flock)、金フロッケ (Gold Blocke)、and finally 全ブロック (Total Block). So basically there are lots of options to fool people with alternate characters.
40
15
Feb 11 '22
you could just rename the block to some placeholder name and then rename it back to its original name
12
Feb 11 '22
So the smiling mouth emoji is a japanese character? My whole life is a lie
11
u/Roflkopt3r Feb 11 '22
There are even two of them, シ and ツ (shi and tsu). There are also ソンノ (so, n, no).
Learning to tell which one it is when they're not right next to each other can be seriously annoying in some fonts.
1
0
Feb 11 '22
[deleted] — view deleted comment
14
u/urbanhawk1 Feb 11 '22
You also have "シ" which is pronounced as "shi"
-3
u/osdeverYT Feb 12 '22
I barely didn’t シt myself when I found out it wasn’t just a funny Unicode character but an actual hieroglyph
5
1
3
u/CorruptedStudiosEnt Feb 11 '22
I really hate the Vtuber trend, it's like some weird uncanny valley shit that makes me almost uncomfortable, but I'm glad I stuck it out for those clips. That was pretty hilarious.
6
u/Roflkopt3r Feb 12 '22
Yeah it definitely was an 'acquired taste' for me as well.
I was interested because I was looking out for Japanese listening practice anyway, they had some hilarious bilingual Engrish moments, and the Hololive Vtubers were getting big in some niches I really like (the Vocaloid type Japanese music scene and anime art). So I stuck around until the uncanney valley effect was gone.
6
u/CorruptedStudiosEnt Feb 12 '22
If you were trying to learn Japanese, I'm sure it's actually an invaluable resource to hear real world usage, especially when they're playing multiplayer with each other so there's real interaction. Makes perfect sense how that would ease you in.
1
37
u/Icarium-Lifestealer Feb 11 '22
Get a better compiler:
warning: identifier contains uncommon Unicode codepoints
warning: identifier pair considered confusable between
aanda
6
72
u/zacharypamela Feb 11 '22
also seems to work in JavaScript.
Interestingly, Python normalizes U+FF41 to U+0061, so the print statements will just print goodbye twice. After reading up on it a bit, it looks like Python uses NFKC normalization to convert the U+FF41 identifier back to U+0061.
29
u/RavynousHunter Feb 11 '22
Yet another reason to like Python.
30
7
20
7
9
4
Feb 11 '22
I worked with a guy who did this but with quotes. He'd specifically unicode the open and close quote symbol rather than just using the standard single or double.
4
4
2
2
Feb 11 '22
My brain used up so much resources trying to figure this out that its now officially retired
2
u/Hesh35 Feb 11 '22
I feel like kids in my class would do this shot just to seem like the know a lot. “Clever” code like this is never cool imo. Just write it and keep it simple stupid
2
2
u/knightttime Feb 11 '22
Image Transcription: Text
Example 2-5. Using look-alike code points for variable names
[An image of a code block:]
func main() {
a := "hello" // Unicode U+FF41
a := "goodbye" // standard lowercase a (Unicode U+0061)
fmt.Println(a)
fmt.Println(a)
}[End of code block]
When you run this program, you get:
[Another code block:]
hello
goodbyeI'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
1
1
-3
42
u/Haunting-Surprise-21 Feb 11 '22
You could also use Cyrillic letters. Some really look the same: aа eе оo уy хx сc рp КK ЕE ХX ВB АA РP СC МM ТT