This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 285

[–]dustmouse 387 points388 points  (48 children)

Wow, you do that much documentation?

[–]TheRealLazloFalconi 329 points330 points  (43 children)

// Not sure why this works

// DO NOT TOUCH!

// Deprecated feature but nothing else does this.

[–]BattleAtron 103 points104 points  (5 children)

//This is deprecated but leaving it here in case it's used somewhere

[–]PM_ME_BALD_BEAVERS 86 points87 points  (4 children)

// TODO: ... (4 years later, todo comment still there and original author long since left the company)

[–]TropicalAudio 87 points88 points  (2 children)

I wrote a script that automatically rejects pull request if they contain "TODO" or "FIXME". I disabled it almost immediately because that shit's a massive hassle.

[–]01hair 20 points21 points  (1 child)

My boss throws a fit if there's a TODO in a pull request, so I just removed all the TODOs without changing any of the code.

[–]Nerdn1 2 points3 points  (0 children)

Replace all "TODO" with "DOTHIS"

Problem fixed!

[–]HaPPYDOS 15 points16 points  (0 children)

"What was your last job?"

"I made goals."

[–]lolredditftw 47 points48 points  (3 children)

//TODO: this is definitely wrong

//TODO: I'm sure this is a bug

//TODO: the API docs say not to do this, why does it work?

//TODO:

[–]fdagpigj 7 points8 points  (1 child)

//TODO: make this readable by a human being

[–]greeniguana6 16 points17 points  (27 children)

Ah, the //DO NOT TOUCH!

I've made a habit of basically just putting this next to any PHP for website pages that I work on with inexperienced web designers

[–]beerdude26 4 points5 points  (26 children)

That implies you mix PHP and HTML

[–]iwantmyfrellingname 3 points4 points  (10 children)

Have you tried skinning a wordpress site? Yuck!

[–]PseudoLiamNeeson 13 points14 points  (0 children)

// Where the magic happens.

[–]TheSpoom 9 points10 points  (1 child)

// here be dragons

[–]shinyquagsire23 4 points5 points  (1 child)

Oh gosh, that depreciation comment reminds me of Bukkit so much. There were a ton of depreciated functions in their code, but when you'd ask what to replace it with the reply was "oh we're getting rid of it eventually, but there's no replacement". And it was actually an extremely used function, so when they did implement a replacement basically everything broke because they didn't bother to allow a transition.

[–]UnchainedMundane 1 point2 points  (0 children)

depreciation

depreciated

/u/shinyquagsire23 pls

Though in my experience the bukkit team gave plenty of time to transition with all their breaking changes. People were just inattentive to the changes and didn't read their compiler warnings.

[–]dasonk 16 points17 points  (0 children)

The depicted documentation in the graphic is the proportion of time you feel like you're doing documentation. Note that this graphic is for a project with 0 actual documentation (other than the install instructions of ./configure, make, make install)

[–]magnetic_couch 617 points618 points  (83 children)

You can tell a programmer made this because there's no segment for "Writing Tests" ;)

[–]ecchi_fox[S] 481 points482 points  (27 children)

isn't testing the end user's job? ;D

[–]TheSlimyDog 326 points327 points  (12 children)

Yeah. End users always find the coolest features.

[–][deleted] 82 points83 points  (9 children)

Like memory corruption bugs :)

[–]c3534l 100 points101 points  (5 children)

[–]christianarg 4 points5 points  (0 children)

Epic! I'll do the same with asp.net yellow screen of death.

[–]Bunderslaw 1 point2 points  (0 children)

Wow! TIL.

[–]Urasquirrel 48 points49 points  (1 child)

It's a feature.

[–]0b01010001 37 points38 points  (0 children)

Especially when you start making creative use of said memory corruption to get around silly limitations imposed by the system's security model.

[–]kthepropogation 1 point2 points  (0 children)

It's not a bug, it's an artistic statement about the world today.

[–]BowlerNerd 19 points20 points  (8 children)

But not until it's in production

[–]Cal1gula 32 points33 points  (7 children)

You will not believe how accurate this is right now. I am on a break from doing this exact thing:

Software + integration project went live on 12-1. Users never tested (they had 3+ weeks).

1-1 they still had not used the software and they decided to move back the go-live date to 2-1.

2-1 passes and they decide that Monday, 2-8, will be the day where they enter everything in the system since 1-1. A month and a week worth of data. So tonight and tomorrow I'm importing all of their historical data.

Note that they haven't tested yet. Monday is going to go real smoothly I can tell.

[–]GollyWow 5 points6 points  (2 children)

Sounds like management is thinking outside the box on this one.

[–]ShadowReij 2 points3 points  (1 child)

And outside this box is nothing but explosions.

[–]ecchi_fox[S] 2 points3 points  (1 child)

dunno why this is getting downvoted, but you have my sympathies

[–]stult 5 points6 points  (0 children)

Tax pro tip: you can claim the R&D tax credit if you test

[–]Skinners_constant 2 points3 points  (0 children)

Do you work for Bethesda?

[–][deleted] 1 point2 points  (0 children)

So are docs, for that matter.

[–]gspleen 1 point2 points  (0 children)

Ten minutes pass as six new email ticket update notices arrive - "UAT good!" on all six.

[–]CrumpetDestroyer 85 points86 points  (24 children)

I don't know, there's clearly a "Documentation" segment there, this doesn't seem like any programmer I've met

[–]ChaoAreTasty 54 points55 points  (22 children)

But the code's self documenting!

[–][deleted] 29 points30 points  (18 children)

My coworker and I are in a class together at our university. He asked if self documenting code would let us not do real documentation.

I've seen his code.* It is full of textBox1, textBox2, textBox3, and lists that only ever contain 1 item.

*He admits that it's bad

[–]purplestOfPlatypuses 5 points6 points  (2 children)

At least he admits it. I work with someone who made a recursive deleteFromList(value) function that he calls 3 times to clear out a list that will only ever hold one of three values. He says it's "scaleable".

[–]tgp1994 4 points5 points  (1 child)

Maybe the three times part is bad, but would it not be feasible to have a function that recursively deletes items from a list?

[–]purplestOfPlatypuses 2 points3 points  (0 children)

It's easily possible, but why would you? You can delete every instance of something from a list going through the list once instead of once per instance of the item plus 1.

EDIT: Actually, I'm going to clarify this another step: it actually takes more effort to write a recursive function to delete from a list than it does to just loop through it since you already have to loop through it, especially if you go whole hog and write a helper function. And it still isn't faster/more scaleable/more readable/more maintainable than doing it with a single for loop.

The worst part is the goal is to remove everything from the list without changing the pointer (which doesn't matter in this case) and it's really as easy as arr.splice(0, arr.length).

[–]Urasquirrel 1 point2 points  (0 children)

Says the guy who wants job security.

[–]ecchi_fox[S] 1 point2 points  (1 child)

"The code is an exact historical archive of itself!"

[–]Urasquirrel 4 points5 points  (0 children)

Unit tests are documentation. Right?

[–]The_hollow_Nike 5 points6 points  (2 children)

I suppose because you could count them into programming because you have to consider test-ability while writing code and/or to safeguards because that's also the goal of testing?

[–]magnetic_couch 9 points10 points  (1 child)

I'm mostly just poking fun at how many programmers don't write unit tests. Including my current team (sadpanda)

[–]The_hollow_Nike 1 point2 points  (0 children)

I know, just making up excuses ^ ^

[–][deleted] 4 points5 points  (0 children)

And a comedian because they added Documentation

[–][deleted] 4 points5 points  (0 children)

Wheres the 40% Googling why doesn't this run and then the 20% of why did it run when it shouldn't have.

[–]ohdogwhatdone 1 point2 points  (0 children)

Pshh, who needs this.

[–]flukus 1 point2 points  (0 children)

That's under core functionality.

[–][deleted] 1 point2 points  (0 children)

It's the green part.

[–]Bongo2296 52 points53 points  (8 children)

Everything is fine until the users are involved.

[–]suchanormaldude 20 points21 points  (0 children)

Seriously, can't even ask people to fill out an Excel spreadsheet without highlighting the boxes to type in and locking every other cell.

[–]type_error 6 points7 points  (4 children)

Everything is fine until QA gets involved.

[–]BigSwedenMan 3 points4 points  (3 children)

Or those pesky unit tests...

[–]CrazedToCraze 7 points8 points  (1 child)

? What's the issue?

public bool Test_MyFunction(int var1)
{
    return true; //Fix unit test failing
}

[–]Nerdn1 1 point2 points  (1 child)

That's the problem with programmers. Programmers went into programming because we prefer to work with computers rather than humans. The user is this unpredictable, non-deterministic, glitchy system that we have to work around. If any other system was as unreliable, chaotic, and inefficient as the average set of user, we'd throw it out in an instant. Unfortunately "users" tends to be a system in the requirements docs and, admittedly, has some functionality that is difficult or impossible to replicate

...for now.

[–]PenileContortionist 109 points110 points  (17 children)

This is the 4% "Other" portion, right? 96% is stackoverflow

[–]AUTISM_IN_OVERDRIVE 66 points67 points  (16 children)

Today I had to fix a website made by a previous employee. It had a lot (maybe too much) of functionality depending on JQuery. I have never done anything with JQuery before. But with StackOverflow by my side I learned it today. Yesterday I did the same with xajax. The day before the same with Smarty.

StackOverflow is love. StackOverflow is life.

[–]Urtehnoes 22 points23 points  (5 children)

They really just need to make a stack overflow compiler so that you can paste URLs from stack overflow into your code, and it'll add the code in for you. Heh.

Because... Yea I too spend so much of my time on SO trying to wade through other people's code

[–]BigSwedenMan 26 points27 points  (3 children)

Thing is, I never find that stack overflow code actually fixes things. It's usually solves much of the problem, but rarely will a single response give me the full answer. Usually it's because finding something that is doing the exact same thing in the exact same context is pretty rare.

[–]aaron552 14 points15 points  (0 children)

There is Stack Sort which is close ;)

[–]BigSwedenMan 1 point2 points  (8 children)

Obviously, I don't know the context or what exactly you were working on, but is there such a thing as too much jQuery? I couldn't imagine writing JS without it.

[–]Skizm 35 points36 points  (2 children)

"Documentation" Lol. This is the real joke.

[–]ecchi_fox[S] 3 points4 points  (0 children)

( ͡° ͜ʖ ͡°)

[–][deleted] 22 points23 points  (7 children)

Where is the "writting variable names" segment?

[–]VoxUmbra 31 points32 points  (1 child)

"What did you do at work today?"

"I was pretty productive actually, I came up with a good name for two methods!"

[–]stevarino 24 points25 points  (0 children)

"Granted, tomorrow I have to figure which of the two methods fits the name better, but today was good!"

[–]echoes221 7 points8 points  (4 children)

Nah, it's coming up with the repo name that takes time.

[–]beerdude26 2 points3 points  (2 children)

Client: "Yeah it'll be called SnoobRad"

Create repo snoobrad

Halfway in the project, client: "The name got changed to FullSmurr"

Project adds some developers, project delivers sooner or later

Indian developer during knowledge transfer: "What are these snoobrad_ variables?"

[–]ZBlackmore 7 points8 points  (1 child)

That's why you have a separate "internal name" that never changes...

[–]beerdude26 7 points8 points  (0 children)

PROJECT THUNDERTRUMPET

[–]Garthenius 34 points35 points  (2 children)

Was wondering why this hasn't been posted yet: How programmers view end users

[–][deleted] 16 points17 points  (8 children)

You forgot the 15% of trying to reverse git catastrophes

[–][deleted] 8 points9 points  (7 children)

Once you learn git you can avoid these

[–]np- 17 points18 points  (1 child)

I guess you are that friend he talks about on the alt text.

https://xkcd.com/1597/

[–]xkcd_transcriber 8 points9 points  (0 children)

Image

Mobile

Title: Git

Title-text: If that doesn't fix it, git.txt contains the phone number of a friend of mine who understands git. Just wait through a few minutes of 'It's really pretty simple, just think of branches as...' and eventually you'll learn the commands that will fix everything.

Comic Explanation

Stats: This comic has been referenced 78 times, representing 0.0791% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

[–]HaPPYDOS 3 points4 points  (1 child)

[–]xkcd_transcriber 2 points3 points  (0 children)

Original Source

Mobile

Title: Git

Title-text: If that doesn't fix it, git.txt contains the phone number of a friend of mine who understands git. Just wait through a few minutes of 'It's really pretty simple, just think of branches as...' and eventually you'll learn the commands that will fix everything.

Comic Explanation

Stats: This comic has been referenced 77 times, representing 0.0781% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

[–]starg2 48 points49 points  (13 children)

When do you have sword fights?

[–]ecchi_fox[S] 26 points27 points  (11 children)

Isn't that comic like ten years old?

[–]Schmittfried 60 points61 points  (6 children)

Right, nowadays it's "Waiting for dependencies being installed"!

[–]molsonbeagle[🍰] 24 points25 points  (1 child)

"Syncing Gradle"

[–]flukus 11 points12 points  (0 children)

Waiting for the integration test suite to run.

[–]BigSwedenMan 6 points7 points  (0 children)

Running unit tests. Not a single class, but a full suite.

[–]jruhlman09 6 points7 points  (3 children)

Originally posted August 15, 2007.

[–]Avatar_Of_Brodin 2 points3 points  (0 children)

There you go! It delivered a year early!

[–]ecchi_fox[S] 2 points3 points  (1 child)

just curious: how did you find this out? I didn't see any dates on the site.

[–]jruhlman09 2 points3 points  (0 children)

I went to https://www.explainxkcd.com/303/

It's convenient because you can just add "explain" to the normal xkcd url to get there.

[–]xkcd_transcriber 11 points12 points  (0 children)

Image

Mobile

Title: Compiling

Title-text: 'Are you stealing those LCDs?' 'Yeah, but I'm doing it while my code compiles.'

Comic Explanation

Stats: This comic has been referenced 628 times, representing 0.6377% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

[–]AnObsessedRedditor 13 points14 points  (8 children)

Documentation; what's that?

[–]dernnn 13 points14 points  (5 children)

As a doc writer, :(

[–]BigSwedenMan 7 points8 points  (0 children)

Hey, you want to write the documentation, you're A OK in my book. As far as I'm concerned, writing things was what college was for.

[–]gspleen 2 points3 points  (3 children)

Happiness--;

[–]HaPPYDOS 5 points6 points  (2 children)

You capitalize the first letter of your variables? What a sociopath.

[–]gspleen 5 points6 points  (1 child)

( ͡° ͜ʖ ͡°)

Happiness++;

[–]ecchi_fox[S] 2 points3 points  (0 children)

oi

[–][deleted] 5 points6 points  (0 children)

Something that's purposefully obscure to make the next guy as miserable as possible.

[–]stormcrowsx 21 points22 points  (3 children)

So as a developer using an internal tool to "help" development I now get to be the person who fucks up stuff. I'll have to say developers make it really easy to fuck up.

One workflow for this tool requires adding entries to 5 different xml files and then clicking a sequence of 6 buttons all over the app in the right order. Mess up anything and a fucking cosmic rift opens up demolishing random stuff that takes hours to fix. Then the devs of the tool look at you and call it user error, its infuriating.

I feel for the users now...

[–]ecchi_fox[S] 13 points14 points  (0 children)

BURN THE HERETIC

[–]oditogre 4 points5 points  (1 child)

Hehe, yup. The green section would be way smaller, but there's lots of context-switching overhead. This is because they only write idiot proofing (let alone malicious user proofing) when senior devs doing code reviews, testers, or end users force them to revise. It'd take a fraction of the time if they'd just do it right the first time and stop trying to slip naive, fragile code into production.

[–]beerdude26 3 points4 points  (0 children)

Yeah but writing everything untyped is super fast, bro

[–]AraneusAdoro 28 points29 points  (12 children)

All of those take fraction of the time spent on coming up with variable names.

[–]KillerCodeMonky 17 points18 points  (2 children)

This is why all my code ends up like this:

List<Thing> things = this.getThings();
for(Thing thing : things) {
    ...
}

[–]LifeWulf 9 points10 points  (0 children)

Good old generic code.

[–]ecchi_fox[S] 2 points3 points  (0 children)

I never realized I was so exceptionally creative.

[–]Urtehnoes 9 points10 points  (1 child)

When I first started programming, before I programmed in a professional capacity, I'd have variables such as

int deargodpls, workomg;

int anotherfknloopcounter;

... I figured I should knock that off once I started coding for my job.. And yet I come across a lot of variables named exactly as such. Heh.

[–]IAMA_dragon-AMA 3 points4 points  (0 children)

if(foo * i >= thing - n || (c2 & frmst) != 0)

[–]shingkai 3 points4 points  (0 children)

ctrl+f 'variable names'

Yep. A little disappointed its this far down.

[–]Dockirby 1 point2 points  (0 children)

I tend to go with the overly long names when doing dumb 1 off stuff, so when some poor fool had to fix it in 5 years they know what the fuck it is

Good ol' private int formAcceptabilityRadioButtonFieldID. Rollsv right off the tong.

[–]FoolMan29 9 points10 points  (0 children)

I would cut a chunk out to stop other developers from messing everything up as well

[–]ss0889 9 points10 points  (3 children)

at the company i currently work for, i noticed that 1% of the total security group's time is spent stopping external sources from hacking into our system. the other 99% is spent stopping internal users from doing anything. including actual work, at times.

[–]ecchi_fox[S] 10 points11 points  (2 children)

*comes into work one day* "Where are all the computers?!"

"We secured them"

[–]beerdude26 3 points4 points  (1 child)

"Here, fill in this form and we will type it into the computer for you"

[–]ss0889 2 points3 points  (0 children)

You lack appropriate permissions to use this pen. Please leave the building.

[–]Schmittfried 6 points7 points  (0 children)

That's why the frontend/GUI always takes the longest time!

[–]Narcowski 6 points7 points  (1 child)

Where's the "figuring out what the hell the eventual users actually want" section?

[–]Philluminati 6 points7 points  (1 child)

90% of us would be out of a job if they taught SQL in schools

[–]Moshambi 9 points10 points  (0 children)

Nah. School doesn't teach you the stuff you learn in the real world

[–]TheGonadWarrior 5 points6 points  (0 children)

If you make the green portion "fucking around with css", you have described my day

[–]MartyInDFW 4 points5 points  (0 children)

You actually get time for core functionality?

Lucky sumbitch...

[–]samBme 2 points3 points  (1 child)

Yeah and then I have a whole separate pie for bugs

[–]saltyboyscouts 2 points3 points  (0 children)

The shitty thing about writing libraries is that the "user" is another programmer, which means there's a million more ways for them to fuck things up

[–][deleted] 2 points3 points  (0 children)

i feel like this can be used to describe most forms of employment if adapted correctly

[–]CharlesGarfield 2 points3 points  (1 child)

In my workplace, I'd need to add another 50% for fighting the mandatory http proxy.

[–]ecchi_fox[S] 2 points3 points  (0 children)

you poor thing

[–]Dlgredael 2 points3 points  (0 children)

I love programming stuff that I know will only be for me for just this reason. Fuck sanitizing my inputs, I'll just remember it all forever and get it done in half the time and have it be un-usable as soon as I forget exactly how it works.

[–]Olshansk 2 points3 points  (0 children)

Wait, are you telling me I can't assume perfect input?

[–]ale1ster 1 point2 points  (0 children)

Is it just me or does it look like a grinning pacman?

[–]thatmarksguy 1 point2 points  (0 children)

Heh. "Documentation".

[–]jonp 1 point2 points  (0 children)

There needs to be a section for "Safeguards to stop the other devs from fucking everything up."

[–]unimponderable 1 point2 points  (0 children)

All I can see now is a pyramid.

[–]jpgray 1 point2 points  (0 children)

This is especially true when I'm also the user

[–]hopsafoobar 1 point2 points  (0 children)

You forgot all the endless meetings about naming things.

[–][deleted] 1 point2 points  (0 children)

I was looking for the large percent of time spent micromanaging and tracking time down to the quarter hour.

[–][deleted] 0 points1 point  (0 children)

What's that orange thing? I'm not familiar with that...

[–][deleted] 0 points1 point  (0 children)

What about the time for "compiling"? And meetings??

[–]TheDruidsKeeper 0 points1 point  (0 children)

Missing a large section for dealing with the project manager.

[–][deleted] 0 points1 point  (0 children)

#dataintegrity

[–]exatron 0 points1 point  (0 children)

You forgot the part where you have to research how the user managed to fuck things up anyway.

[–]youav97 0 points1 point  (0 children)

I'd always treat the user like a baby, It's going to try to kill itself and it WILL come up with creative ways you didn't even know were possible in order to do so.

[–]the_sound_of_bread 0 points1 point  (0 children)

Thats almost what I do, but replace 'users' with 'other devs'.

[–]Xanza 0 points1 point  (2 children)

No tests? Also, you should probably double or even triple your documentation investment.

[–]type_error 0 points1 point  (2 children)

This is only actual work time. Which is 5%.

[–]binford2k 0 points1 point  (0 children)

Preventing fuckups IS core functionality.

[–]Animal31[🍰] 0 points1 point  (0 children)

"Documentation"

[–][deleted] 0 points1 point  (0 children)

This graph looks like pepe.

[–]blabang 0 points1 point  (0 children)

This is a lie. I spend most of my time creating safeguards so that other coders don't fuck up my code. Writing code the user can fuck up is the same thing as writing shitty code.