What's the worst code you've ever written?

What's the worst code you've ever written?

Other urls found in this thread:

patreon.com/freebsdgirl
github.com/freebsdgirl?tab=overview&from=2018-03-01&to=2018-03-03
twitter.com/SFWRedditGifs

#define for(init, condition, do, loop)\
for( init; condition; do )\
{\
loop;\
}

WHY

Back before I discovered divs I made websites using tables with no borders. Just imagine a bunch of



And trying to remember which one did what.

Oneliner loops, I'd imagine.

There was an infosec student who needed a POC program (which would access all kinds of devices in the system in a predefined way) for his dimploma. He asked several people who agreed to do it for him but threw him under the bus one after another. I never knew him, he found me through our mutual contact which I was communicating for a short time. He needed it in a week.

This was a C++/Qt/WinAPI job, I pasted insane amounts of code, I messed with inefficient UI template which he gave me to do it faster, it has zero comments besides those which were in original code which I pasted and it had insane amount of WinAPI boilerplate code. I also had only a Vista laptop ATM and there were no recent VS for Vista so I preferred Qt/MinGW - until I found out that some COM/OLE (or wtf it is called) code won't work with MinGW. I was forced into making second executable with earlier version of Qt and VS only to use that specific piece of code which I could not manage to make work under MinGW.

And I managed to make this shit work almost flawlessly. The most horrible parts of that code are WinAPI/COM/OLE code.

but you could just as easily do
for (init; condition; do) loop;

How I handle CORS
header("Access-Control-Allow-Origin: " . (!empty($_SERVER["HTTP_ORIGIN"]) ? "{$_SERVER['HTTP_ORIGIN']}" : "*"));
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Max-Age: 86400");
if ($_SERVER["REQUEST_METHOD"] == "OPTIONS") {
if (isset($_SERVER["HTTP_ACCESS_CONTROL_REQUEST_METHOD"])) {
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
}
if (isset($_SERVER["HTTP_ACCESS_CONTROL_REQUEST_HEADERS"])) {
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
}
exit(0);
}

saves typing 3 semi-colons

Just submitted a school project where the entire program relied on a single infinite for loop with a switch case inside it, some parts of which had 5 or more conditional continue statements inside them

This massive matlab script for a uni assessment. But the code wasn't assessed it was how well it performed. I've always wanted to go back and refactor the code though.

code of conduct

Probably this shit

Fuck off back to Sup Forums

Fuck off back to Tumblr.

I'm so embarrassed and ashamed over having a slight beer gut how can these people not suicide daily?

i'm ashamed that people pay this fat cunt 2K a month to do nothing. patreon.com/freebsdgirl
>0 github commits during this period
github.com/freebsdgirl?tab=overview&from=2018-03-01&to=2018-03-03

A shitty arduino code I made with tons of global variables.

My DNA
>technically I didn't write it but it's really bad

your link refutes what you're saying. about what i expected from a Sup Forumstard though.

>patreon.com/freebsdgirl
we just need 500$ to invite her to our "event" where we murder "her"

>had to go into hided after being swatted

lmao

That's what everyone used to do. And now we're almost full circle with people basically doing tables in CSS.

A 3.5k lines LaTeX document with practically zero comments and a compilation time in the minutes, if I ever have to change the time graphics I am going to kill myself.

Also some iterative solvers for Linear systems of Equations entirely without any comments or indication why they work, although that doesn't really matter anyway.

...

if (AF_INET == conn)
ip = malloc(4);
else if (AF_INET6 == conn)
ip = malloc(16)
inet_ntop(conn, addr, ip, AF_INET == conn : 4 ? (AF_INET6 == conn : 16 ? 0));

you better clean that code up a bit before you start copypasting it

All of them : (

It's fixed now so there must be someone monitoring these threads.