r/badcode • u/WasserTyp69 • May 01 '22
c++ Because while(true) would've been too boring - spotted in a GH repo with over 7k stars
1.4k
Upvotes
r/badcode • u/WasserTyp69 • May 01 '22
319
u/Voltra_Neo May 01 '22
A class named
Global... I smell trouble109
u/Pangocciolo May 01 '22
Which language is this?
autois a C++ hint, butnot,not_eq?23
u/[deleted] May 01 '22
what repo?
14
u/[deleted] May 01 '22
you have to give him credit for creativity
225
u/ZuriPL May 01 '22
I think it was intentional, as whoever wrote that code was bored. Or gets paid by the amount of code written
28
u/db2 May 01 '22
If it's the same one I found the author says it's intentional as a joke.
6
u/AlanWik May 01 '22
Lol. I'm sick enough to know that this is the repo of some fancy htop alternative.
alias b = h
10
u/Professional-Bus-441 May 01 '22
I like to use while (1)
4
u/MurdoMaclachlan public boolean isInt(int i) { return true; } May 02 '22
Image Transcription: Code
[The last two lines of the following code are cut off in the image:]
I'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!
9
u/[deleted] May 01 '22
sEniOr pROgrAmMer 🍎💻😎🌃🤩
5
u/1337GameDev May 01 '22
Lol they likely did it as a joke.
The interpreter will simplify that expression likely anyways.
It's so obviously bad that there's no other explanation
2
u/lostsemicolon May 02 '22
Oh no. This feels like something I would do.
2
u/deep_mind_ May 02 '22
It’s not bad code, he was just bored. That’s gonna get optimised out anyway
1
u/protocod May 02 '22
I think you should push a PR.
1
u/Bachooga May 02 '22
1
u/zombarista May 02 '22
For some reason, despite being black/white, night/day folks seem to struggle with booleans more than any other data type. I’m always seeing stuff like this in code reviews!
1
u/kingdango May 06 '22
twisted
1
u/Unshortafleur May 01 '22
What the hell is even that
0
u/[deleted] May 01 '22
[deleted] — view deleted comment