r/badcode • u/Phpminor • Aug 06 '21
other language 3 months ago, I wrote this abomination of nested switches, if-then-else's, and namespace violations.
85
Upvotes
r/badcode • u/Phpminor • Aug 06 '21
14
u/Phpminor Aug 06 '21 edited Aug 06 '21
This was all part of a project I haven't put out yet, made in SQF for Arma 3, hence why I have to use notepad++ for my 'IDE' again.
This was part of some loadout system made up entirely of mission scripts, so a player could look through a list of loadouts that other players made, different times, different servers, different mods, all would be on this list.
If this monstrosity isn't enough to sate r/badcode's hunger I'll post my 'dynamically generated' UI, which is a recreation of the modern paginator entirely in SQF, using nothing but arma 3's native UI commands.
Here's the code for this file
5
u/Voltra_Neo Aug 06 '21
What I like about this subreddit is that when we post our own code we're so ashamed we don't even open it in our editor and just screenshot whatever basic editor is laying around
10
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Aug 06 '21
Image Transcription: Code
[Thanks to OP for providing a link to the source in this comment. I have placed the section visible in the image here for ease of access and to highlight exactly which section it is.]
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
2
u/flavius-as Aug 07 '21
Very good example of abominations. Thanks!
0
u/[deleted] Aug 07 '21
[deleted] — view deleted comment