Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
The Management
Jan 2, 2010

sup, bitch?
this thread is for posting your colleagues’ (and your own) terrible code and laughing at it. today I found this (api anonymized and condensed for clarity). see how many things you can find wrong with it.

code:

while (true) {
  success = thing->open();
  if (success) {
    createThreadToDoWork();
    joinWorkThread();
  }
  thing->close();
}

Adbot
ADBOT LOVES YOU

burning swine
May 26, 2004



heh it's bad

cinci zoo sniper
Mar 15, 2013




*81 kilobyte large uncommented sql select query*

burning swine
May 26, 2004



I once wrote some bitwise logic for parsing arguments in, of all things, ruby

can't find it now though

cinci zoo sniper
Mar 15, 2013




COACHS SPORT BAR posted:

I once wrote some bitwise logic for parsing arguments in, of all things, ruby

can't find it now though

i wrote a salary parser in python last week

20 branch if statement because i couldnt be arsed to parse salary ranges

RISCy Business
Jun 17, 2015

bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork
Fun Shoe
im piss

Stymie
Jan 9, 2001

by LITERALLY AN ADMIN
the joke is that all code is terrible and laughable even if implemented "correctly"

Agile Vector
May 21, 2007

scrum bored



omg the truest stymie post

akadajet
Sep 14, 2003

Stymie posted:

the joke is that all code is terrible and laughable even if implemented "correctly"

i've been saying this poo poo and quoting stymie for years

atomicthumbs
Dec 26, 2010


We're in the business of extending man's senses.
sounds like whoever did this was a real bastard operator from hell, op

ADINSX
Sep 9, 2003

Wanna run with my crew huh? Rule cyberspace and crunch numbers like I do?

I once wrote some code that was really dumb and bad

ADINSX
Sep 9, 2003

Wanna run with my crew huh? Rule cyberspace and crunch numbers like I do?

it was yesterday and almost every day before that for the last 15 years :unsmigghh:

lampey
Mar 27, 2012

who wrote this garbage

check on it and realize i wrote it six months ago

must have been a good idea at the time

Moo Cowabunga
Jun 15, 2009

[Office Worker.




looks good to me,op?

The Management
Jan 2, 2010

sup, bitch?

Displeased Moo Cow posted:

looks good to me,op?

it creates a thread, waits for it to finish, then restarts and creates another thread. instead of just having a loop. it literally has thread whose whole job is to wait on another thread to run to completion.
it closes the thing even if failed to open it.
if open fails, it will be an infinite loop of system calls that will bring your system to its knees.

A Pinball Wizard
Mar 23, 2005

I know every trick, no freak's gonna beat my hands

College Slice
today's wtf is these forums

George
Nov 27, 2004

No love for your made-up things.
no that was yesterdays

Moo Cowabunga
Jun 15, 2009

[Office Worker.




Coding is for nerds with brains and bad social skills and wads of dosh :smugmrgw:

Adbot
ADBOT LOVES YOU

post hole digger
Mar 21, 2011

lampey posted:

who wrote this garbage

check on it and realize i wrote it six months ago

must have been a good idea at the time

  • Locked thread