r/geek • • Mar 19 '17

When you write bad code that works.

24.0k Upvotes

377 comments sorted by

1.3k

u/ipha Mar 20 '17

I think everyone has looked at their old code and thought "this _shouldn't_ work"

845

u/lordnecro Mar 20 '17

This shouldn't work but does... guess I will go ahead and clean it up. Wait, now it should work but doesn't.

1.1k

u/RanaktheGreen Mar 20 '17

99 bugs in the code

99 bugs in the code.

Take one down, patch it around,

127 bugs in the code.

458

u/baubaugo Mar 20 '17

but not 128, because that would be an extra bit.

189

u/XkF21WNJ Mar 20 '17

Don't you hate it when you end up with -128 bugs in your code and need to add extra bugs to get back to 0.

173

u/[deleted] Mar 20 '17

128 bugs in the code 128 bugs in the code take one down it 65536 dependencies around It's release day and you are essentially fucked

→ More replies (6)
→ More replies (20)

80

u/ioxon Mar 20 '17

Have an upbit for that.

6

u/echo-chamber-chaos Mar 20 '17

Now there's 128. Thanks for the buffer overflow.

→ More replies (3)

50

u/minastirith1 Mar 20 '17

Oh man my sides. Not even a programmer but this was my experience when I had to learn MATLAB.

68

u/Eurynom0s Mar 20 '17 edited Mar 20 '17

For a programming language that targets scientists and engineers who don't know programming but need to be able to learn a bare minimum of it in order to implement numeric models, it sure is boneheaded about letting you do some stupid things.

Years ago on reddit someone posted a story where they spent a large part of a summer internship tearing their hair out because their results were coming back pure real but should have been complex. The guy finally tracked down that if you use i as a loop variable it'll overwrite the default i == sqrt(-1) (and will leave i as whatever the last value of the loop variable was).

I can understand why that's valid behavior but given the target audience it should REALLY at least get flagged with a "are you sure you want to do this?" warning.

[edit] Thank you to /u/pnml129 for pointing out I forgot the sqrt for the value of i.

29

u/lnsulnsu Mar 20 '17

Not to mention 1-indexing everything. So many stupid errors because I'm used to 0-indexing everything, and then matlab uses 1-indexes.

I get it, it intuitively makes sense for someone coming from a math-first background with little to no programming experience. But it screws anyone who is used to working in C-family languages.

→ More replies (4)

21

u/Spaser Mar 20 '17

Haha, I remember running in to this same issue early in my MATLAB days. Now I always use ii, jj,... even in non-MATLAB code, just as a habit.

→ More replies (1)
→ More replies (4)
→ More replies (3)

20

u/poopyheadthrowaway Mar 20 '17 edited Mar 20 '17

It compiled yesterday and I didn't change anything, but it won't compile today!

It wouldn't compile yesterday and I didn't change anything but it compiles today!

→ More replies (1)

8

u/ViewFromTheFront Mar 20 '17

I got 99 bugs but a bit ain't one

→ More replies (2)
→ More replies (4)

69

u/ipha Mar 20 '17

Then you put it back the way it was and it still doesn't work.

31

u/indyK1ng Mar 20 '17

And then after two hours of trying to figure out what's going on, you realize that Visual Studio hasn't actually rebuilt the binaries. Or you weren't being as careful in reproducing the bug as you thought.

64

u/Dray_Gunn Mar 20 '17

That is the exact reason i never got into IT when everyone told me i should because im "good with computers". I know computers well enough to know i dont want to work with them.

72

u/lordnecro Mar 20 '17

Completely agree. I worked as a programmer and in IT each for a few years. Decided there was no way I wanted to do that for the rest of my life.

I still remember a comment in a code I wrote nearly 15 years ago... it was something like "Do not ever move or remove this line or the entire program stops working. I don't know why".

30

u/Eurynom0s Mar 20 '17

Yup, more than once I've had to write comments like "I don't know why this works but it does, it would be good to fix this later if there's time".

→ More replies (2)

6

u/[deleted] Mar 20 '17 edited Mar 20 '17

Unfortunately it took me 20 years to find find this out for myself.

18

u/mortalitybot Mar 20 '17

took me 20 years

That is approximately 27.910983% of the average human life.

→ More replies (2)
→ More replies (1)

14

u/snakespm Mar 20 '17

Reminds me of one of my project courses in college. One of the projects had a block of code maybe 20 or 30 lines, with comments around it effectively saying "Not sure what this code does, but it makes everything work. DO NOT TOUCH." Apparently it was written by someone who drank way to much red bull, and couldn't remember what he did when he woke up the next day.

→ More replies (3)

60

u/andsoitgoes42 Mar 20 '17

As a former "hey I read a book and copied people so I can program" guy, this was any code I wrote. I was basically the guy who stuck duct tape on every bursting seam (of which there were many) and would wipe the sweat every time it worked.

I'll make it clear that I no longer program so I am ensuring I'm not fucking anyone's life up trying to fix shit. Other than my own stuff like DDWRT routers and raspberry Pi machines which is still like a 2 year old trying to solve a Rubik's cube.

58

u/neoform Mar 20 '17

As a former "hey I read a book and copied people so I can program" guy, this was any code I wrote.

AKA: A junior programmer learning to code.

Everyone starts this way.

27

u/tempest_ Mar 20 '17 edited Mar 20 '17

The problem is when people get stuck in that phase.

I am currently in the paralysis by analysis stage, where I cant seem to start on anything because there has to be a better way than the naive solution that immediately came to mind.

This sometimes produces incredibility graceful and clever pieces of code but more often than not produces a rushed buggy naive solution just to get it done.

13

u/[deleted] Mar 20 '17

Just keep in mind that the best way to do things is not usually the best way to do things.

This is because although your program may run more efficiently, you lost some efficiency when you spent 12 times longer writing the code than you otherwise would have.

If you're righting a code to solve a specific class of problems only a few times, it doesn't need to be super efficient and it doesn't need to be overly general. It just has to be good enough.

Programmers should be heuristic algorithms that find good enough ways to do things, not theoretically perfect ways to do things.

→ More replies (1)
→ More replies (2)
→ More replies (3)

10

u/zeekar Mar 20 '17

"What idiot wrote this?"

21

u/ipha Mar 20 '17

git blame

... shit

4

u/treblecharged Mar 20 '17

Oh dear lord... that reminds of the time I discovered a multi-line C# if statement that was ported from VB 6.... that at every line of the if statement was "&& +"... how the fuck did that compile? I haven't a clue. I went to the customer site and found this treasure amongst others and failed an install with our customer. It was SO embarrassing. That project was a nightmare but I wasn't responsible for that bit.

1

u/CBruce Mar 20 '17

And then it immediately stops working....

1

u/JasonDJ Mar 20 '17

Networking guy here who fucking hates NAT on Cisco Routers. Give me a proper firewall or give me death.

Shit just "worked" the other day. Have no idea how. Looking at captures it almost looked as if the NAT did what I wanted it to, despite me knowingly fucking it up. Like, I could look specifically at the configuration and know that it's wrong, but somehow, miraculously, it was working.

1

u/ThorBreakBeatGod Mar 21 '17

I have a 24 to 72 time-loop uttering that sentence. (72 hours if it's on the weekend and I don't look at my friday code, of course.)

0

u/[deleted] Mar 20 '17

[deleted]

136

u/ipha Mar 20 '17

43

u/Official-b0wie_ Mar 20 '17

god damn it

27

u/[deleted] Mar 20 '17 edited Apr 06 '17

deleted 0.3604 What is ^^^this?

15

u/P-01S Mar 20 '17

Bah.

No exit condition and the only side-effect is wasted time.

→ More replies (1)

14

u/[deleted] Mar 20 '17

I'm surprised you found 42 threads with exactly the same comments. What are the chances?

0

u/[deleted] Mar 20 '17

[deleted]

→ More replies (2)

12

u/notLOL Mar 20 '17 edited Mar 20 '17

Wordpress used to link the headline to itself. So the title headline would be "current post 01" and it was the anchor text that links to the same page.

For some reason Wordpress blogs were well known to rank really well and no one really understood why. My pet theory is that a google crawler bot kept incrementing whatever count it had as it reloaded the page (not in a single run but over the course of many).

It's like a personal credit score where you get a higher credit score because the credit issuer sees you have a high credit score. But they're the only ones who are increasing it every time.

I think it's the same reason obscure Reddit comments get on google search results so fast. Each comment self references itself through out the thread.

Experiment: Randomstringoftextforgoogle

Google search:
https://www.google.com/search?q=Randomstringoftextforgoogle

6

u/[deleted] Mar 20 '17

No base case, am stuck permanently. send help.

→ More replies (4)

9

u/BromeyerofSolairina Mar 20 '17

I know I'm being obnoxious with this comment but:

A phrase like that really irks me. Seems like it would teach kids to be okay with not really understanding recursion. It's not magic. It's not even that difficult once you practice it.

4

u/[deleted] Mar 20 '17

And yet most people don't understand recursion. (Eg. all the people repeating an image as a "recursive" joke.) You're right, not having it explained properly is probably where it all starts. But it's not an easy concept. Recursion, pointers and concurrency are some of the hardest things in CS.

12

u/FrankReshman Mar 20 '17

If you ever have to start a sentence with "I know I'm being obnoxious with this comment but..." it's probably best not to say the thing you were going to say.

→ More replies (2)
→ More replies (4)
→ More replies (1)

1.0k

u/LeftHandBandito_ Mar 19 '17

That's called the "fuck it bridge"

169

u/hazeust Mar 20 '17

No. It's called the, "band-aid bridge"

Gotta get that alliteration lol

→ More replies (20)
→ More replies (6)

281

u/Luder714 Mar 19 '17

Every macro I ever wrote in Excel.

45

u/[deleted] Mar 20 '17

I don't know why you or others dislike excel and its VBA... I did my university studies and spent most of my working life on those two programs.

41

u/GroteStreet Mar 20 '17

Engineering or finance?

35

u/[deleted] Mar 20 '17

finance

54

u/Meakis Mar 20 '17

There we have it.

→ More replies (2)

34

u/[deleted] Mar 20 '17

As a programmer (professionally) this is why:

  1. It's non intuitive. Most programming languages are structured nothing like vb. Statically typed languages are either C-style [type] [varname] or like mathematics [varname] : [type]. Dim _ as _ is unintuitive and annoying, and that's just one example.

  2. The excel APIs can be very.... particular. I made a few macros for my girlfriend before and there was a tiny bug I fixed that had to do with setting a value within the function call that had a very unintuitive fix (I forget what it was specifically).

  3. The runtime is very, again and I swear this is the last time I Say it, unintuitive. you "create" macros which you run in a button or as a shortcut? Then what if some library doesn't import? Then wtf do you do?

Everything about excel and VBA is shitty as a programmer and if you programmed in multiple languages, you'd realize how shitty VBA feels to write, compared to both statically typed and dynamically typed languages. It feels like writing fucking modern COBOL.

Not that it's particularly performant either. It's stuck to whatever performance excel can pump out, which basically means you might as well just use numpy and the pypy ecosystem for your numerical stuff unless you need very specific finance tools such as the excel solver, and even then I think it's doable.

It just sucks, but my SO is in finance and finance people tend to view programming as a tool, not as their career, so they don't give a fuck. If you do programming for a living, you tend to be more particular and develop preferences, what you like and dislike.

9

u/[deleted] Mar 20 '17

finance people

Not just them, everybody thinks about programming like that. Programmers are the only ones who care about programming itself. And even they have to overcome this if they want to advance their career.

→ More replies (8)
→ More replies (8)

4

u/themouseinator Mar 20 '17

I actually really enjoy using VBA in excel, but it's kind of a mess of a programming language.

→ More replies (3)

2

u/[deleted] Mar 20 '17

As far as programming languages go VBA is messy to use, the syntax is difficult to read and it's just very unintuitive in general. I will concede that some might find the syntax intuitive, though. To each their own.

→ More replies (3)
→ More replies (4)

400

u/gunch Mar 20 '17

84

u/jjmod Mar 20 '17

I don't get it, how is a CPU a rock?

225

u/lungdart Mar 20 '17

Transistors are silicon, rocks can be as well

107

u/lnsulnsu Mar 20 '17

Its silicon, mixed with some other mineral-derived elements. The materials to make it were mostly all dug out of the ground.

30

u/Saul_Firehand Mar 20 '17

What if I told you everything is dug out of the ground.
Except birds and... shit I guess just some things.
It isn't as mind boggling if just a lot of stuff comes from the ground though.

15

u/mindsnare Mar 20 '17

Everything does, we do, birds do, everything. Just some more indirectly than others.

→ More replies (6)
→ More replies (8)

32

u/CameToComplain_v4 Mar 20 '17

Microchips are made of silicon. Silicon is the second-most plentiful element in the Earth's crust, after oxygen. The other parts of a microchip are other kinds of metal, i.e. other rocks we dig up from the ground.

12

u/flare1028us Mar 20 '17

The elements that compose the CPU.

9

u/jroddie4 Mar 20 '17

it's made out of fancy dirt

7

u/randomguy186 Mar 20 '17

CPUs are made of silicon.

Silicon is made from silica (very pure silicon dioxide.)

Silica is made from sand, which is mostly tiny pieces of quartz rock, which is mostly silicon dioxide.

→ More replies (1)

4

u/unbrokenPhantom Mar 20 '17

"Not to oversimplify, first you have to flatten the rock and put lightning inside it"

→ More replies (1)

24

u/dalovindj Mar 20 '17

If you leave hydrogen alone for long enough, eventually it begins to think about itself.

5

u/Bart_Thievescant Mar 20 '17

And then we put lightning inside it.

18

u/rukus23 Mar 20 '17

A thing is more than teh sum of its parts.

42

u/[deleted] Mar 20 '17

No it isn't, you metaphysical dweeb

7

u/racc8290 Mar 20 '17

Something something emergent properties

→ More replies (1)
→ More replies (2)
→ More replies (6)

67

u/julian88888888 Mar 20 '17 edited Mar 20 '17

What's this game?

*edit, https://store.steampowered.com/app/367450/ $12.

46

u/IlIIIIIIllI Mar 20 '17

Poly Bridge

9

u/jakfrist Mar 20 '17

If you add http:// to the front the link should work.

3

u/[deleted] Mar 20 '17

Https

→ More replies (1)

1

u/BernieSander Mar 20 '17

Came here for this

0

u/[deleted] Mar 20 '17

[deleted]

→ More replies (2)

115

u/Ginkgopsida Mar 19 '17

35

u/cromiium Mar 20 '17

Damn, I really wanted this sub to be active.

85

u/BobLobLawsLawBlawg Mar 20 '17 edited Mar 20 '17

It was but the mods wrote a script that broke the rendering of it and couldn't log back in

8

u/cromiium Mar 20 '17

You got me for a moment

16

u/[deleted] Mar 20 '17 edited Mar 20 '17

Check these place out

/r/badcode

/r/shittyprogramming

→ More replies (1)
→ More replies (1)

1

u/dtlv5813 Mar 20 '17

I wonder what is the time complexity of the program illustrated by op

30

u/TheGamingEngineer Mar 20 '17

So I'm not a programmer, and I typically lurk this sub solely for entertainment, but the analogy implied here got me thinking. Is it actually possible to code up something that achieves the desired objective only once and then always fails on subsequent runs (besides a random number generator)? Normally I would think that a code would have some element of repeatability that would make this impossible, no?

53

u/SirTyrael Mar 20 '17

Quick example of a yes to this answer.

Write a piece of code that opens a file. Reads the information in the file. Does some calculation. Saves the value of the computation in the same file or overwrites it.

Everythings good.

Run it again & everything blows up because the value of the computation wasn't saved in the right format.

57

u/hoadlck Mar 20 '17

Oh, yes. It can happen. It does happen.

Someone tests the feature, and it works the first time...so ship it. But, when the user tries to do the feature twice, it breaks.

21

u/Fig1024 Mar 20 '17

the most common case is when your application / algorithm performs properly for the first task you give it, corrupts some memory while doing so, but finishes properly. The next task you give it will have significantly higher chance of failure because process memory is corrupted.

Of course, restarting the application would "fix it" for the first case.

That's why the first thing you do is try turning it off and on again

5

u/TheGamingEngineer Mar 20 '17

This is the most interesting answer thus far. Thanks!

7

u/[deleted] Mar 20 '17

The more interesting answer is that literally a neutron or a proton moving at almost light speed comes from space and hits just that one specific tiny piece of your computer to flip it to the wrong value.

https://en.wikipedia.org/wiki/Soft_error#Alpha_particles_from_package_decay

3

u/TotesMessenger Mar 20 '17

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)

3

u/ehcolem Mar 20 '17

Not only possible but common, although ususally not as nicely as 'only once.' It is more like it works a bunch of times for unknown random reasons and then one time doesn't work for what ultimately becomes an obvious reason. :-)

2

u/silentpat530 Mar 20 '17

Yeah it's possible. Especially if it's intended. But it's possible you do something that accidentally makes it only work once as well.

2

u/MeanestBossEver Mar 20 '17

Most common variation of this that I see is code that only works in the development environment. Periodically this is because someone hard coded in the development environment. /headdesk/

1

u/xakeri Mar 20 '17

I wrote some code that read a URL path from a config and saved it to a variable and then got another thing to stick on the end of the path and then call some other stuff to make an HTTP request to that URL.

It only worked the first time because the variable was being appended to the end of the path every time it was called.

1

u/greengo Mar 20 '17

A good analogy would be your company just hired you to write a Shakespearian play. It should both match the Old English style and be as good as all the plays he wrote (e.g. a masterpiece). You've read his work extensively and think you might be able to come up with some decent stuff. Alas, you work on a team of writers, as the deadline is very short. One of the other writers is from Japan, and you're having trouble fitting in his pieces because the translation is a bit weird. The other guy is from New Orleans and tells some great jokes, but it's not helping the end goal that much. The last guy is from Colorado and just rolls in high every day but somehow actually turns in the best work. Ok, now where is that masterpiece?

1

u/miellaby Mar 20 '17

Not exactly in the way depicted in the gif. The program doesn't deteriorate all by itself. But piece of codes have side effects, including "collateral damages". For example, reserving resources -let's say the camera of your smartphone- and forgetting to release it. As a whole, these side effects means that every time you run any program, the conditions are slightly different every time.

→ More replies (2)

52

u/[deleted] Mar 19 '17

Looks legit to me.

19

u/balidani Mar 20 '17

Bridge properly destructs after use, no memory leaks, ship it!

3

u/drylube Mar 20 '17

It just works

19

u/Doeboyfresh35 Mar 20 '17

Fiserv products..😔

17

u/topgun966 Mar 20 '17

Fiserv

As someone who has to work with them all the time ... this made me laugh .... and then cry and cringe.

11

u/nighthawke75 Mar 20 '17

That makes two of us.

Bastards keep breaking their own certificates and then pretending that nothing happened, only that "it must be something wrong with their browser" all the while every teller and CSR's work comes to a screeching halt due to their browsers breaking FOR THE SAME DAMNED REASON.

→ More replies (5)

6

u/jeaguilar Mar 20 '17

Duct tape and manual reconciliation.

4

u/zack2491 Mar 20 '17

Too close to home...

1

u/1RedOne Mar 20 '17

Their banking remote desktop / VM cludge thing, lol

1

u/Dockirby Mar 20 '17

Please don't say that word to me, you are making me dread the fact I have to document how our integration with them actually works in the next month.

18

u/pickoneforme Mar 20 '17

there's a game called "fantastic contraption" that is similar to this. you build weird vehicles to move the red object from the starting point to the finish point over all sorts of different obstacles. it was awesome.

2

u/spacecowgoesmoo Mar 20 '17

2

u/MeisterKarl Mar 20 '17

Oh yes. TIM is the best! Spent so mant childhood hours in that game and I still can't figure out some of the puzzles 15 years later

24

u/phishyrf Mar 20 '17

Poly bridge is a hugely underrated game..the music makes the game even better.

21

u/Antrikshy Mar 20 '17

Really? I've seen 500,000 gifs of it on Reddit.

4

u/Mildly-disturbing Mar 20 '17

Still not enough

→ More replies (1)

8

u/JediDwag Mar 20 '17

The code achieved the objective. I don't know how, but my work here is done.

7

u/[deleted] Mar 20 '17

I'm at the point with my job right now where the company let a few people go and I've taken over maintaining/updating the former employees' code and responsibilities and I've never been so demoralized before. I spend so much time optimizing and rewriting my own code, and these people have written some of the worst "just trying to make it work" hardcode-ridden programming I've ever seen and it's a nightmare trying to fix problems or change anything. And now I'm responsible for cleaning it all up and fixing all the bugs I never knew existed, while still working on my original scripts. 22 years old fixing 50+ year olds' code. Big dose of reality for me recently

5

u/xelf Mar 20 '17

When you write bad code that works

...once

4

u/Distinctionx Mar 20 '17

What game is this

4

u/Platt13 Mar 20 '17

Poly bridge. It's available on steam.

3

u/greyjackal Mar 20 '17

It's IBleedOrange, back from the dead. And having never written a line of code in his life.

3

u/AvoidMySnipes Mar 20 '17

How old is this post... Jesus christ.

3

u/snorkleboy Mar 20 '17

Personally I think it's impressive that the bridge gets deleted after use.

3

u/Steve_the_Stevedore Mar 20 '17

That's how career advancement works:

Fuck shit up and jump ship before the company drags you down with it!

3

u/[deleted] Mar 20 '17

But that bridge looks like it's harder to build than if you just did it the right wa...

...oh, this analogy is deep.

2

u/[deleted] Mar 20 '17

this reminds of how my coworkers work and when they make a pull request. Then I comment it like there shit is fucked like this to which they respond that it works and "I don't see why I need to change it if it works."

2

u/blockbaven Mar 20 '17

If it's stupid but it works, it's still really really stupid

2

u/jroddie4 Mar 20 '17

until someone comes back 5 years from now and rewrites it a jillion times faster as a single ramp because it no longer plays nice

→ More replies (1)

2

u/[deleted] Mar 20 '17

What a redundant title.

When you write bad code that works.

2

u/Wellhowboutdat Mar 20 '17

Working as intended.

2

u/gameschess Mar 20 '17

"Later nerds" - Truck Driver

1

u/[deleted] Mar 20 '17

"When". Aren't you sweet.

1

u/unperturbium Mar 20 '17

Meh, write a better firewall.

1

u/[deleted] Mar 20 '17

"Don't dam the bridge you crossed"

1

u/DuesCataclysmos Mar 20 '17

Sometimes you just have to break a loop.

1

u/[deleted] Mar 20 '17

As a student taking a couple of programming classes in his senior year of high school, this is how most of my homework programs work

1

u/Bonchee Mar 20 '17

I always imagined the superrich did stuff like this irl when they ran out of things to do. The ole' one time use bridge.

1

u/joshuaoha Mar 20 '17

That gif made my computer crash.

1

u/fapping_bird Mar 20 '17

What game is this? This is fantastic!

1

u/nathew42 Mar 20 '17

Poly bridge, available on steam. I highly recommend it

1

u/MrRandyWatsonYeah Mar 20 '17

What game is this?

1

u/nathew42 Mar 20 '17

Poly bridge, available on steam

→ More replies (1)

1

u/m4bwav Mar 20 '17

Validate your input parameters often enough and its hard not to get something to work.

1

u/[deleted] Mar 20 '17

I love this game but damn it can be almost too hard sometimes.

1

u/slippytoadstada Mar 20 '17

Bad code that works- did you mean snapchat?

1

u/nomnaut Mar 20 '17

This is accurate. It's an iterator with a StopIteration to handle an exception. In this case, when the bridge is out.

1

u/[deleted] Mar 20 '17

I think I just wrote one today

1

u/mtarascio Mar 20 '17

I'm not sure, it landed perfectly with an acceleration.

Seemed superior to the outcome that was originally envisaged.

It spent more time at the execution stage but then sped to the next instruction.

Someone needs to do the maths.

1

u/[deleted] Mar 20 '17

It's only stupid if it doesn't work

1

u/leemachine85 Mar 20 '17

It compiled, tag as release!

1

u/grandaddy7 Mar 20 '17

This game looks fun and I want to buy it.

Then I read reviews and people are like the game looked fun so I bought it but it wasn't as much fun to play.

1

u/heyomayo- Mar 20 '17

its pretty fun but you gotta be smart, it gets very hard

1

u/thecatsleeps Mar 20 '17

Hey they just asked get truck for point a to point b. Not my fault bridge collapses.

1

u/[deleted] Mar 20 '17

Nailed it.

1

u/gray_gb Mar 20 '17

test it in prod, baby!!

1

u/Reformed_Scrafty Mar 20 '17

This reminds me of Fantastic Contraption.

1

u/CottonStig Mar 20 '17

Is this how League of Legends is coded?

1

u/Demonify Mar 20 '17

Just curious, what was it supposed to do?

1

u/Sir_Jerry Mar 20 '17

Hey, it worked when I tested it.

1

u/Pleb_nz Mar 20 '17

Customer 'it worked the first time, now it's fucked' Support 'please power off your machine then turn back on and it should be fine'

1

u/[deleted] Mar 20 '17

But then...

...the 492 pass and it starts executing the data...

1

u/everno99 Mar 20 '17

Reminds me of how Mr Burns is almost immortal because he has so many diseases, they actually cancel each other out.

1

u/gamerABES Mar 20 '17

Ah, the infamous Big O.

1

u/[deleted] Mar 20 '17

Code like that won't pass DevOps for deployment.

1

u/denach644 Mar 20 '17

Get in here, /u/myrthe- !

1

u/[deleted] Mar 20 '17

ASU, Fall 2015, MAE 384 assignment 4.... Yes. This is the perfect visual description of what I submitted that day. It was so bad, I remember it still...

1

u/urbn Mar 20 '17

The internet if built on fuckitworks code.

1

u/[deleted] Mar 20 '17

All the filemaker scripts I wrote to enable that standalone software to become a semi-usable ERP for an SME.

1

u/dixeography Mar 20 '17

Works only once and has loops, looks about right

1

u/quickie_ss Mar 20 '17

What is this program?

1

u/[deleted] Mar 20 '17

Windows 98, is that you?

1

u/artisticano Mar 20 '17

Hahaha that's me with excel macros

1

u/SCPoPo Mar 20 '17

looks like my code after a night of drinking and coding... "IDK wtf I did last night but it works... good to go for me...

1

u/therighttobecool Mar 20 '17

Bad code that works should still work repeatedly so that makes no sense. It would just look really messy. Think of a house made of a bunch of bricks in haphazard shapes but you put so much fucking cement on it, the house looks messy but it still holds strong. Another one would be how the Millennium Falcon from Star Wars looks like a mess of stuff glued together (though it looks flawless to me) but it runs okay

1

u/[deleted] Mar 20 '17

As a non coder (or at least don't consider myself one, just know basic programming in Python & C++), how the hell do you go about programming anything 3D or representative?

1

u/[deleted] Mar 20 '17

This is timely, we're doing this year's appraisal, and this about sums up my self evaluation.

1

u/SarenSabertooth Mar 20 '17

Lmao I try to be all clean and make nice objects and asynchronous functions for days, but in the end I think most my code works like that and I should just hack most of it and save myself the time of even trying… It seems more fun when you invest the least effort and get the most out of it.

1

u/tinyrickyeah Mar 20 '17

I want to learn to code, shitty code even!

1

u/gershom45 Mar 20 '17

Can cofirm.

Had to login just to upvote.

1

u/djh1997 Mar 20 '17

But does it scale to 2 cars

1

u/eshemuta Mar 20 '17

That looks like half the applications I support

1

u/SupremeRedditBot Mar 20 '17

Congrats for reaching r/all/top/ (of the day, top 50) with your post!  


I am a bot, probably quite annoying, I mean no harm ^though

Message me to add your account or subreddit to my ^blacklist

1

u/Kubrick_Fan Mar 20 '17

i'm using a tablet, is it meant to glitch halfway through?

1

u/bakemonosan Mar 20 '17

commit, push.

1

u/[deleted] Mar 20 '17

It's.. It's beautiful

1

u/CRISPR Mar 20 '17

That's not the end of the story. The story is that this gif never stops and bad code that worked and became legacy while working and being bad and tons of good stuff was built that is relying on that bad stuff.

And at that point changing the bad stuff requires a lot of LOE

1

u/Doeboyfresh35 Mar 20 '17

I work for them.. the software is trash and poorly developed. They roll it out with very little testing and let the client and support reps figure out what works and what doesn't. Jank ass Janks..!

2

u/Christian_Akacro Mar 20 '17

As a mod of r/Polybridge and the Producer of the game; that is entirely false.

1

u/sirmoveon Mar 20 '17

Bad code you say; Smart code I say.

In the business world they call it planned obsolescence. Lets cut the double standards, shall we?

6

u/CCninja86 Mar 20 '17

After only running it once? Damn, that's some fast-paced obsolescence!

1

u/Animal31 Mar 20 '17

There is no such thing as bad code that works

1

u/andys1337 Mar 20 '17

As long as it compiles and I get credit for the assignment

1

u/[deleted] Mar 20 '17

Sometimes when constructing a logic statement in a program my mind goes blank and I just try things until it works. This captures that process perfectly.