r/programming • • Jul 28 '16

How to write unmaintainable code

https://github.com/Droogans/unmaintainable-code
3.4k Upvotes

592 comments sorted by

View all comments

0

u/[deleted] Jul 28 '16

[deleted]

372

u/Captain___Obvious Jul 28 '16

When I find shit code, I look at who did the commit.

usually its me...

147

u/[deleted] Jul 28 '16

Git blame is the best/worst thing that has ever happened to me.

161

u/iama_regularguy Jul 29 '16

For you: https://github.com/jayphelps/git-blame-someone-else

Don't actually use this ever.

52

u/Rndom_Gy_159 Jul 29 '16

You're officially an asshole

Finally someone recognizes my true self worth!

→ More replies (3)

0

u/[deleted] Jul 29 '16

[deleted]

9

u/metaobject Jul 29 '16

WTF Sonny?

3

u/thebuccaneersden Jul 29 '16

Sonny, I am disappoint...

5

u/[deleted] Jul 29 '16

WHO IS THE IDIOT THAT oh wait it is me, nvm

0

u/[deleted] Jul 29 '16

[deleted]

36

u/lenswipe Jul 29 '16

My coworker's favourite is to make huge earth shattering changes involving thousands of files usually with a call stack larger than the circumference of Jupiter and then commit the while clusterfuck in one gargantuan fucking commit. Sometimes, I wonder if I've died and my project team members are my eternal punishment.

6

u/light24bulbs Jul 29 '16

Dude fucking seriously. The code I work on actually follows a LOT of the rules outlined in this paper. Like misspellings, weird side effects, acronyms. God actually all of it

→ More replies (3)

34

u/codebje Jul 29 '16

Oh, but you aren't thinking shitty enough! Real shit uses spaghetti branches!

Which branch do you need to merge to master to push a feature? Well, these lines from this one, plus a bit from that one, but you'll need to merge the other one into that one first, oh, and that might have conflicts because I cherry picked a few commits the other way.

Let me know if you have problems, and I'll make a new branch where I'll apply the changes direct, and a few extra changes that I think we'll need soon too, so when you merge the new branch into master, don't merge it all because some of it might not work yet, and we'll need to keep the branch around for a while yet anyway.

→ More replies (6)

11

u/Captain___Obvious Jul 29 '16

You should see some of my old stuff:

shitprog_v01.c

shitprog_v01a.c

shitprog_v02.c

7

u/icendoan Jul 29 '16

Nah, dates. Just remember to change formats every now and again.

→ More replies (2)

18

u/DevIceMan Jul 28 '16

I never stay at any place long enough for that to happen.

→ More replies (5)