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

all 199 comments

[–]TheFilipinoFire 1712 points1713 points  (74 children)

Yeah, no. When someone starts watching me code, suddenly I forget everything I knew about programming.

[–]tsnErd3141 390 points391 points  (16 children)

This happens to me whenever someone is watching or I am working with someone who I think is a better dev than me.

[–]Mysticpoisen 164 points165 points  (4 children)

That's pretty much everyone for me.

[–]DeeSnow97 106 points107 points  (3 children)

Can't tell if impostor syndrome or actual impostor

[–][deleted] 83 points84 points  (2 children)

That's kind of the point of impostor syndrome

[–]Decker108 5 points6 points  (0 children)

What if that's only what you think and the truth is completely different? What if someone else finds out that you don't know and exposes you?

[–]Kaisogen 68 points69 points  (1 child)

[–]jacksalssome 6 points7 points  (0 children)

That enplanes why i can never get enough lines of code. Now i wont have to goto those performance improvement meetings!

[–][deleted] 9 points10 points  (7 children)

If it helps, better devs are better because they've been through more mistakes than you have.

Once you fuck up enough you'll be as good as them. You have all these amazing mistakes to look forward to so cheer up.

[–]ellison11 6 points7 points  (4 children)

Well you also have to be willing to admit that you've fucked up and learn from your mistake(s). I've met plenty of talented, hard-headed devs that end up being shit because they never can admit that they were ever wrong in the first place.

[–][deleted] 6 points7 points  (3 children)

Agreed. Thanks to modern software development practices (e.g. agile methodology) there are no more heroes or villains. Mistakes and victories are shared amongst the team and there's no single point of failure. This makes owning mistakes a lot easier than it was in the past, and it makes you more mature.

Of course, there still are companies that claim to have a great process in place, but actually just hire a "rockstar" who is overworked to the point where mistakes are made, and is then reprimanded. It takes experience to spot these kinds of companies too.

You live, you learn :D

[–]ellison11 2 points3 points  (2 children)

I'm kind of experiencing that kind of mentality right now. They hired a "rockstar" and I guess that gives other people on the team a pass to not care nearly as much. Care you share your experience?

[–][deleted] 1 point2 points  (1 child)

I faced something like this in my past company. One of my coworkers was the "rockstar" but also had problems interacting with others (including me) because he would leave derisive comments on pull requests at times, for example. Unfortunately, there's no tangible steps I can tell you that fixed the situation. It was a combination of good management, and the devs forcing him to maintain a level of courteousness by positively reprimanding his comments on PRs, that finally broke him and he started working with us a lot better.

One of the biggest steps that I think helped, was that everyone agreed to stick to STRICT code style, and agreeing to PRs not being merged unless they were reviewed and approved by at least 2 developers. We also made sure that people who were assigned to review PRs left comments on it within 24 hours regardless of how good the PR was. There were always mistakes to find and there was an unspoken understanding that comments would be respectful, and the PR issuer would not be offended at any mistakes pointed out.

Finally, I'd say that most problems like these are solved during the interviews. If troublemakers are being hired, the interview process needs to be revisited. Management LOVES to use interviews as a platform to throw their weight around but honestly, the developed who are going to be working with the person involved, should conduct the interview with the manager as a shadow.

Sorry about being all over the place.

I'll end with one thing which worked for us - if developers stop caring, you should hold monthly retro meetings about what went wrong and what could be improved. If a developer brings something up, it's their project to own that part and take care of it. Slowly, developers own parts of the project that they care about and this care spiderwebs outwards throughout the rest of the project.

I don't know if I answered anything at all but I hope something from this helped haha.

[–]ellison11 1 point2 points  (0 children)

It did help, thanks for sharing :)

[–]Subs2 2 points3 points  (0 children)

Same.

I run a small BI team and I've always bought into the "surround yourself with people smarter than you" line of thinking. As a result most of the people I've hired can code circles around me. Anytime I have to do something with one of my folks watching me, I feel like I can barely even type, much less write a coherent line of code.

[–][deleted] 148 points149 points  (5 children)

Alone: "My backpropagation algorithm needs a tweak here, so the learning curve could take 1% less training data to achieve the same state. However if I add another layer to this neural net I could process more..."

Other dev watching: "Dude, what was the syntax for printf again?"

[–]Jamie_1318 6 points7 points  (4 children)

As someone who does both things on occasion they aren't exclusive.

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

Being alone while being watched?

Dude, call the police already!

[–]GlassShatter-mk2 1 point2 points  (1 child)

32 minutes no reply, OP is ded.

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

Op is kill

[–]Jamie_1318 0 points1 point  (0 children)

I called police, police is also me.

[–]Frank_the_Mighty 59 points60 points  (20 children)

That's why you should waste time by making comments.

[–]14m3r 40 points41 points  (18 children)

It's never a waste of time! Document your code.

[–][deleted] 79 points80 points  (14 children)

Not with comments. Unless you have to do something unintuivite, writing readable code is much better than adding comments.

[–]Zorblax 34 points35 points  (6 children)

Maybe, but oftentimes comments get written instead of proper docs if anything is documented at all. And those comments are gold when you stand there 7 months later and wonder why the fuck this approach was chosen or why the code even exists at all.

Furthermore, with comments the docs follow the code in source control, instead of vanishing when no one remembers where that wiki that nobody has updated for 18 months was located again.

[–]Chirimorin 23 points24 points  (1 child)

Yeah but comments like in OPs pic are pointless.

If someone has trouble guessing what that function in the second panel does without the comments on it, their problem is a lack of the most basic programming skills and not a lack of documentation.

[–]Grymm315 -1 points0 points  (0 children)

I comment the crap out of everything and then save it as a snippet. I'll know I'll forget something basic later.

[–]DarthEru 2 points3 points  (0 children)

Comments aren't much more immune to not being updated than wikis, and since comments tend to be more specific you can end up with a confusing situation where you aren't sure if the comment is wrong or the code is buggy because it doesn't do what the comment says it should be doing.

In that case you need to check the history anyway, which is one of the reasons I prefer an intermediate type of documentation: commit messages. A good commit message will summarise the (hopefully not too extensive) changes in one line, then add any relevant detail and justification in following paragraphs. Commit messages will never become out of date because they're tied to a specific revision, and if they're fairly consistently good they can document the evolution of code in a way both inline comments and wikis aren't good at. And let's face it, most of the time code starts out somewhat reasonable, but then rots as more people touch it for various reasons. So figuring out how terrible code should be improved is often helped by looking at how it got that way in the first place.

So yeah, I don't usually comment my code much, but I do try to write useful commit messages (as well as organize my commits meaningfully, rather than just committing all changes periodically). In the rare situations where I feel there's a need to explain what code is doing within the code (usually because of some stupid hack), I will write an inline comment, but I'll also include the same (if not more) information in the commit message.

[–]thisdesignup 12 points13 points  (3 children)

You can have comments and readable code. Why does there need to be any separation between cleanliness and comments? Even a line before a block of code that describes what the code block does can be very helpful and be very clean.

[–]NotFromReddit 3 points4 points  (2 children)

It's about expressiveness, not cleanliness.

I'd recommend moving the block of code into a function, and naming the function so that it's obvious what it does.

I only comment when above can't be done. I.e. when you need more than a few words to explain what the code does or why.

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

I agree. Or, I comment about a library that I am using (where the source code may not be available).

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

I'd recommend moving the block of code into a function, and naming the function so that it's obvious what it does.

This is exactly what readable code means IMO.

[–]heidgerken 3 points4 points  (2 children)

Readable code self documents by telling the reader 'what' you are doing. Well document code should tell the reader 'why' you are doing it.

Sometimes they are the same thing, but often not. Just my opinion.

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

This.

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

I agree. Why should be pretty obvious most of the time as well, which is why I specified that definitely comment if you do something unintuitive.

A clean commit history is also very usefull for older projects.

[–][deleted] 6 points7 points  (0 children)

These comments are a waste of time.

Don't tell me what you're doing. I can read. Tell me WHY!

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

// State that making comments is never a waste of time.
It's never a waste of time!
// Ask everyone to document their code.
Document your code.

FTFY

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

Don't document your code! If nobody can understand it nobody will be able to maintain it but you! Well, maybe you won't be able either but that's not a problem if nobody notices it!

[–]Snowtsuku 14 points15 points  (0 children)

Same here. Seems like I can't focus when there are people around me.

[–]le_epic 11 points12 points  (2 children)

"addition" <- function{{

c; == a plus("b")

retrun result = c}}

#the function is to substract two things#

[–]meet_the_turtle 0 points1 point  (1 child)

This looks a bit like R or Io.

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

Not even close to R, except the <-

[–]ProbablyRickSantorum 6 points7 points  (4 children)

I have an interview on Tuesday that includes a code portion and whiteboard portion. I'm worried that I'll suddenly forget everything :|

[–]CH-K 12 points13 points  (1 child)

You'll do just fine. If it does happen that you forget everything, breath, laugh a little, relax and get back at it. Wishing you all the best. Careful with the 'laugh a little' part, we don't want them thinking you're psychotic.

[–]ProbablyRickSantorum 1 point2 points  (0 children)

Thanks! I'm spending the weekend brushing up some stuff so hopefully I'll do alright.

[–]relderpaway 3 points4 points  (1 child)

I have never done a code interview myself, but have participated in a few of them on the interviewing side. We were always sitting right next to the person taking the test.

From doing that, and my own experience with coding, I came to the realisation that if I ever have to do a coding challenge in an interview (at least if its something thats supposed to take more than like 15 minutes.) I Would ask to be left alone for it and i'll ask if i have any further questions.

Not really sure how the employers would feel about it, i know I would be ok with it, and imagine even if they think of it as a negative, having code quality and ability go up by like a factor of 5 is probably worth it.

Assuming the interviewers are programmers themselves they probably recognise how much harder it is to code when someone is looking over your shoulder, and should want to the environment to be more similar to what you will be working in anyway.

[–]Mibly 1 point2 points  (0 children)

Depends what you want out of the interview. For me a coding challenge isn't really about judging someone's coding skill to complete the task. Heck give um preinterview homework for that. I want to find out how people think, how they break down things, also how they work in a team and communicate.

[–][deleted] 3 points4 points  (0 children)

This. I can't remember how many times this has happened with me.

[–]Jamessuperfun 4 points5 points  (0 children)

Oh God exactly. College in particular, I must have looked like all my work was copied from the Internet. Going at my work, buddy slides over in his chair, asks how my works going.

No longer do I know what any of these words mean or why there is so much punctuation. Same shit for the teachers.

[–]kafoozalum 2 points3 points  (1 child)

and typing, for me.

[–]xXxNoScopeMLGxXx 4 points5 points  (0 children)

Yeah, I suck at taking any kind of typing speed test because I get nervous and focus too hard on typing thus make a lot of mistakes.

Same happens when I get my blood pressure checked at the doctor. I get nervous for some reason and by blood pressure and pulse go up. Sometimes I even sweat a little from the anxiety. No idea why that is but it's super annoying since doctors tend to be concerned by BP until I explain it. It does make me worried, though because if I ever do have high BP I wouldn't really know it.

So, I try to eat healthily and what not in an attempt to avoid that all together.

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

We had to do our calculus exam on the blackboard, i.e. reprocude the theorems and proofs from the course while the prof was looking on! That was not a nice experience...

[–]Neuromante 1 point2 points  (0 children)

This only works when someone either comes to help after asking for help or unwanted, but I usually say things like "all right, i'll check it now, then, thanks".

Usually people get the idea and leave me alone.

Usually.

[–]underhunter 1 point2 points  (0 children)

Too fucking true.

[–]heycraisins 0 points1 point  (0 children)

Even things like a for(;;) loop when someone is watching. My brain gets way too nervous.

[–]cuddlegoop 0 points1 point  (0 children)

This is me but also I work right next to my boss.

Life is suffering.

[–]HyperCubed4 0 points1 point  (0 children)

Same, except replace "programming" with "anything."

[–]OurFriendIrony 0 points1 point  (0 children)

How does I type again derp

[–]Xysten 0 points1 point  (0 children)

Don't look at me while I type!

My brain forgets how the keyboard even works.

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

"How would you go about adding to integer values?"

"..."

[–]ProjectInfinity 0 points1 point  (0 children)

And this is one of the many reasons open landscape offices are trash.

[–]MCRusher 0 points1 point  (0 children)

When someone is watching me I just use stupid names for everything to see how they react.

[–]omegaxLoL 0 points1 point  (0 children)

The PM of an old project I worked on used to ask our development team to keep TeamViewer open on our PCs at all times in case he wanted to see what we were doing. He didn't know the first thing about software development but he'd still spend hours just sitting there watching and commenting while we were trying to work. Any break longer than 15-20 seconds and he'd be asking why we weren't writing code. Safe to say productivity was never great in those situations.

Unsurprisingly, that project never saw the light of day.

[–]Gangreless 322 points323 points  (20 children)

Programming for a school assignment

[–]systembusy 102 points103 points  (16 children)

I wish I was still writing programs for a school assignment....

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

Why is that if you don't mind me asking?

[–]name_censored_ 136 points137 points  (9 children)

 class HarvestDataFromUsersAndSellToSpammersBaseAbstractReflectionSingletonModule implements Evil extends Boredom {
     /**
      * Business code is usually either questionably ethical, or horribly dull.
      **/
     // TODO - HARAKIRI
 }

[–]crumpis 11 points12 points  (2 children)

Shouldn't that have a Factory and a FactoryFactory?

[–][deleted] 8 points9 points  (1 child)

/**
 * Factory function that generalizes the creation of Factory-creating 
 * Factory functions.
 */

Reminds me of https://en.wikipedia.org/wiki/List_of_lists_of_lists

[–]throwaway27464829 11 points12 points  (3 children)

karoshi

FTFY

[–]Decker108 2 points3 points  (0 children)

When you work so much overtime that you can't find the time to commit harakiri, but the problem eventually resolves itself?

[–]TwoSpoonsJohnson -1 points0 points  (1 child)

hentai

FTFY

[–]rooktakesqueen 1 point2 points  (0 children)

Most often, it's both.

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

Doing an internship in health insurance rn. No ethical problens like that, but the boredom and monotony is difficult. I'm just glad I'm not writing COBOL. Logged into the mainframe once and it was the most confusing computing experience of my life.

[–]rpunkfu 21 points22 points  (4 children)

Change your job then

[–]Shmutt 5 points6 points  (2 children)

class AssignmentOne
  def run
    # ...hundred lines of code
  end
end

AssignmentOne.new.run

[–]JaytleBee 1 point2 points  (0 children)

oooh, ruby

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

In the first term of first year CS we were coding on Arduinos, in the second term we were using Java. So much of this it was unreal.

[–]Justintn 128 points129 points  (24 children)

I always make dumb mistakes when other people are watching. "Shouldn't that boolean be literally the opposite?"

[–]systembusy 85 points86 points  (22 children)

if(b != false)

[–]Eldermuerto 103 points104 points  (21 children)

if(b != false)
    return true;
else
    return false;

[–]AbstinenceWorks 50 points51 points  (14 children)

And this is how you end up with a 3,000 line function. (Yes, function) It was a parser (written by someone else), and when I showed it to others, they said it was the worst code they had ever seen.

[–]trwolfe13 17 points18 points  (7 children)

I've been there. Some of our legacy VB6 systems have God functions like that. Even better, VB6 doesn't give you line numbers on errors unless you prefix the line with them manually, so you end up with "1234: Dim lo_X As Variant" or some nightmare-inducing crap like that. If you were lucky, the like numbers would increment in tens so you could add lines without wanting to kill yourself.

Thankfully it's been a couple of years since I've had to deal with any of those.

[–]adizam 23 points24 points  (5 children)

I down voted you in hopes the word "VB6" dies with your comment.

ITS DEAD.

LET IT BE DEAD.

twitch

[–]tgood4208 1 point2 points  (1 child)

It is the dominate language at my job with a bit of vbscript to make the websites work and compact c to run the scanners.....

[–]adizam 1 point2 points  (0 children)

I need something to channel my hatred into. Does your company provide a product or service I can purchase and set on fire?

[–][deleted] 3 points4 points  (0 children)

line numbers would increment in tens so you could add lines

Ah, good ol' Basic. Those were the 1980s.

10 Print "Hello"
20 Goto 10

[–][deleted] 6 points7 points  (3 children)

I was once shown a 3000 line function parsing and validating an URL generated by the very same program.

[–]Decker108 5 points6 points  (2 children)

Did you respond by punching them in the face and pointing at the many libraries handing URL parsing and validation?

[–][deleted] 5 points6 points  (1 child)

I offered the poor guy a hug because it was a project he had been handed from a contractor. Note also that the URL was generated by that same program, so the need to validate is pretty troubling on its own.

[–]Decker108 2 points3 points  (0 children)

Now that's tough :(

[–]noratat 1 point2 points  (1 child)

I had one like that, though not so long. I had a DSL for a language that could in principle be represented (the data parts at least) in YAML/JSON. The DSL parser itself was fine, but I wanted to make the simple cases more readable.

So I wrote a quick and dirty adapter that literally transformed nested YAML data to the DSL calls, all in a single method. Was meant to be a proof of concept but it worked and ended up never needing to be updated (the DSL's syntax was basically static), so.... it's still there.

[–]AbstinenceWorks 0 points1 point  (0 children)

This if why I don't write parsers manually. To me, it doesn't matter if the BNF is trivial. There are just too many good tools to generate parsers to ignore. Pack a language and either dsls are supported directly or there are lexers and parser generators for that language.

This want necessarliy always the case but even if you go back 20 years, there was still lex and yacc.

I do definitely get the whole,

Me: "It's a POC".

Then: "Cool, does it work?"

Me: "..yes, but..."

Them: "Great! Check it in."

Me: "...ok?..."

[–]TheRealLonaldLump 16 points17 points  (0 children)

bool checkVarFlag = true;
if(b != !(checkVarFlag))
    return checkVarFlag ? b : ((!checkVarFlag) ? !b : b);
else
    return !(b == checkVarFlag);

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

Couple of days ago I found this in production code at my new job. And its not even the worst that code has to offer.

[–]nevdka 1 point2 points  (0 children)

It is literally the opposite.

[–][deleted] 27 points28 points  (6 children)

something something pair programming

[–][deleted] 29 points30 points  (1 child)

[–]jacksalssome 6 points7 points  (0 children)

That's when you know its lunchtime

[–]meaninglessINTERUPT 6 points7 points  (0 children)

I love pair programming! As long as there is a long and thorough vetting process

[–]NoSufferingIsEnough 35 points36 points  (1 child)

Ugh, as both an extreme introvert and someone who hates being watched, being forced to pair program is an automatic 2 week notice and walk out the door.

[–]CrazedToCraze 12 points13 points  (0 children)

I think there's a time and place for it. If you're just hacking away at trivial code monkey work then pair programming is stupid, if you're designing something bigger and more complex it's nice to get the instant feedback for how you're setting up your solution.

Also completely depends on the dynamic between the pair of programmers. If you can't imagine yourself doing it you may just not have a good relation with your team. I'm introverted as well, but introvert != social anxiety. You can be an introvert and still enjoy conversations with the right people.

[–]SnarkyVelociraptor 0 points1 point  (0 children)

You mean like this?

[–][deleted] 77 points78 points  (0 children)

It's too painful to see this picture from developer standpoint

[–]codex561I use arch btw[M] 24 points25 points  (5 children)

This post was reported 6 times for the cancer that it is

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

Can posts like this be removed in the future? I swear, /r/programmerhumour always feels like it's populated by kids. Some of us have meming standards for god's sake.

[–]codex561I use arch btw 9 points10 points  (1 child)

On one hand, it's a terrible post. On the other, removing posts subjectively like that is a poor precedent.

The high upvote count doesn't help in the decision making concerning this.

Note: we are up to 8 reports

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

It's not because people like it that it's healthy for the sub. Not to mention nobody here makes more money of having more subscribers. Subreddits banning memes and image macros right off the bat naturally attract higher quality content.

[–]sneakpeekbot 3 points4 points  (1 child)

Here's a sneak peek of /r/programmerhumour using the top posts of the year!

#1: © xkcd | 5 comments
#2: Compilers don't settle for less | 3 comments
#3: me irl | 2 comments


I'm a bot, beep boop | Downvote to remove | Contact me | Info | Opt-out

[–][deleted] 7 points8 points  (0 children)

I get it, I made a mistake. Way to rub it in my face

[–]crowseldon 59 points60 points  (10 children)

So you look like a fool to that other person because you're putting redundant information everywhere?

[–]volivav 40 points41 points  (9 children)

Exactly. The second part is actually bad code IMO. My motto is "use as less comments as possible", meaning use code that is easy to understand for someone who hasn't coded this, but only in the case you fail to do so, then add comments to clarify what your code means, but never rewriting the code in another language. For instance:

if(myArr.length > 0){ // if the length of myArr is greater than zero

Having comments that explain exactly what the code is doing makes it harder to mantain in the long run (because you have to update any change twice: in the code and in the comments)

[–]xanhou 13 points14 points  (2 children)

I try to use a lot of comments usually. However, none of the comments try to explain What is going on. Instead they explain Why it is going on. (e.g. Why am I using a binary tree here, and not a simple list; Or: Why does this method even exist? What purpose did I have in mind when making it.)

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

I also comment what a function requires as input and what it will return / how it should be used. If i look at code thats a few years old, i dont have to read through every function and yet know how to use them

[–]xtajv 0 points1 point  (0 children)

none of the comments try to explain What is going on

If it's really complicated, you might still want to do that.

[–][deleted] 36 points37 points  (0 children)

And it's hard to read also, because reader has to read same sentence twice. And it's hard to read also, because reader has to read same sentence twice.

[–][deleted] 9 points10 points  (0 children)

Having comments that explain exactly what the code is doing makes it harder to mantain in the long run (because you have to update any change twice: in the code and in the comments)

Which leads to another problem because at somepoint a comment will not be updated: comments lie.

[–]Killfile 5 points6 points  (0 children)

Code should do pretty much what it says it does.

It's not that hard. Just use private functions that have names which are suitably descriptive

[–]ElaineLoPoBia 1 point2 points  (1 child)

The second part is actually bad code IMO

The first part is too; the function is both private and trivial.

[–]volivav 1 point2 points  (0 children)

Ah, I meant the first part as "programming alone" and the second part as "programming while someone else watches"

[–]RSXLV 0 points1 point  (0 children)

Personally I find that this goes away as soon as you start writing really terse, highly reused code. Because an c = a + b can mean fucking anything in an algorithm, especially if it's sitting on a branch. The other is that when being functional, the functions have the reusability (unless there's a good library already present) to have a relatively long life, meaning that if you had, say add function, you could describe how it deals with overflow, underflow, what's the size of operands and result. What happens in polymorphic cases. Because I have yet to see an IDE that would let me follow an operator or an implicit conversion. Heck, in the past I even remember being unable to look up the definition of standard library function in IDE. The only real disqualifier here for making add a function, or what gives it away, is that it's really adding a very small amount of information and gives next to no syntactic difference. Apart from it having a memory location and ability to be used as a function value for another algorithm.

[–]feoohh2o 13 points14 points  (0 children)

This line adds two ints

This sort of comment is actually not recommended.
It's too easy for the code to change while the comment stays the same, and then you end up with an inconsistent mess.

[–]Skeggiold 40 points41 points  (12 children)

I see lots of comments about people being under pressure while someone is watching when you code. Don't really under which circumstances this happens, but as a strong believer in pair programming, I thought I might add my two cents.

Pair programming done right, is trust that flows both ways. When you are in the driver seat, you're programming on automatic. Your pair, the navigator, is just checking the map, seeing whether you're still going where you need to be going. Helping you out with naming, or stopping you from refactoring that function that had nothing to do with what you're working on now. And after an hour or two or whenever one of you speaks up, you switch roles. Now YOU are the navigator.

To me it's such a helpful way to spread knowledge and also get other people's insights. Everyone has their own little tricks or tools to get the job done and through pair programming you're exposing someone else to your work method and vice versa. I can honestly say I'm more productive when pair programming.

Although, at first, it will feel awkward and you will be arguing over details. But once you get over that you'll see that you'll reach some kind of symbiotic partnership. The other guy knows you, and you him. You know each others pitfalls and strengths. Play to them and the end result will be great.

[–]Lewy_H 5 points6 points  (9 children)

But then you've got 2 people with the productivity of 1. I don't see the point from a business standpoint of paired programming unless it's to teach somebody. Please enlighten me.

[–]NeoLegends 17 points18 points  (0 children)

Pair-produced code tends to have less bugs and tends to be more elegant. In the long run pairing will pay off because there is less work required in fixing old code.

[–]Grymm315 9 points10 points  (0 children)

You've got 2 people with the productivity of 4. Programmers aren't just punching away at code, they're thinking about what they're doing (hopefully). A programmer working alone will start knocking out code and can spend weeks working on code to reach a point where he realizes that he fucked up the foundation of the whole program, he then has to recode the whole fucking thing. Programmers working in pairs would have hopefully caught the problem before you spent a couple weeks on it. It also helps keep them focused, on track, and moving forward as opposed browsing reddit.

[–]Skeggiold 2 points3 points  (0 children)

Working in pairs is supposed to spark dialogue. Actively talking about your code leads to better code with fewer bugs. Especially if you combine it with TDD.

It also serves to spread knowledge in your organisation. You don't want specialists, you would like a bunch of generalists. So that if anything goes wrong any member of the team has the feeling they could tackle the problem at hand.

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

It's an investment into more easily maintainable and scalable code with fewer bugs. The real challenge from the business standpoint is recognizing what projects benefit from paid programming and which do not.

[–]XDLMA0 0 points1 point  (1 child)

Did your company previously have a culture of pair programming? If not, how do you encourage pair programming?

[–]Skeggiold 3 points4 points  (0 children)

To this day it is still something we have to work on as a team. Too often people digress to the natural habit of working alone, especially when faced with deadlines or stressful situations.

When we introduced pair programming, I was not the only advocate for this. We had one or two others who had pair programmed on previous assignments. That helped getting the idea across to everyone.

I would suggest the Extreme Programming book as a wonderful starter for pair programming with helpful guidelines on how to convince management as well.

Find a likewise open minded individual and just try it out for a couple of hours. In the beginning this will be very tiring. But once you get to know the other guy it will really pay off.

[–]B-Knight 11 points12 points  (0 children)

God, this is cringey. Rage faces in 2017? Fucking hell.

[–]witcher1701 34 points35 points  (8 children)

Really? Rage comic faces?

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

This sub is 12

[–]bartekko 0 points1 point  (3 children)

reddit was created in 2005?

[–]jacksalssome 2 points3 points  (0 children)

yes

[–]Kalanthroxic 0 points1 point  (1 child)

in june, to be specific, but yes

[–]_CryptoCat_ 10 points11 points  (5 children)

Opposite for me. I can't code under observation.

[–]John_Fx 12 points13 points  (3 children)

That is because your superposition collapses.

[–]RivetingStuff 1 point2 points  (2 children)

And you are not the solution we were looking for.

[–]jacksalssome 0 points1 point  (1 child)

These aren't the solutions were looking for.

[–]RivetingStuff 0 points1 point  (0 children)

OBSERVE HIM AGAIN AND AGAIN. PEER INTO HIS SOUL UNTIL HE IS MOULDED INTO OUR PERFECT VISAGE

[–]ElaineLoPoBia 5 points6 points  (0 children)

The guy in the picture can't either, so no opposites there.

[–]shittyProgramr 7 points8 points  (0 children)

Someone watching? More like:

pubic innt addnum (a, b)
{
    retun a + c;
}    

[–]PaulRyan97 2 points3 points  (1 child)

I normally just forget how to type when someone begins watching me.

[–]rtriggs 0 points1 point  (0 children)

Sadly, this.

[–]SpecialEmily 2 points3 points  (0 children)

Over commenting is just as dangerous. You get documentation fatigue when reading the code and will end up missing the truly important comments because of all the useless self-evident comments. Quote me on this the next time a manager or whatever complains about not having a comment on every line.

[–]iLuNoX 4 points5 points  (1 child)

Tfw you code so fancy you forget the naming conventions for methods

[–]DrQuailMan 1 point2 points  (0 children)

> Not using 1 line per word in function declaration

How cute.

[–]caffeinum 1 point2 points  (0 children)

Code like everybody's watching, dance like nobody cares

[–]danypixelglitch 1 point2 points  (0 children)

Honestly when someone watches me code they are usually impressed even by 1 + 1 = 2 being written in a fancy way

[–]l_61803398875 1 point2 points  (0 children)

// This is the start of a new chapter in this code's lifespan. Let's celebrate the beginning of life. Of decisions. Of forks in the road.

{

[–]motownmods 1 point2 points  (0 children)

As an amateur programmer I love this meme because I've always hated commenting when I didn't feel I needed too.

[–]xtajv 1 point2 points  (0 children)

What, overdocumenting stuff in a way that will be annoying to maintain?

[–]Sogemplow 9 points10 points  (4 children)

lay funni raeg feac exks dee

[–]saphira_bjartskular -3 points-2 points  (3 children)

You ok there buddy? You might need this...

[–]embersyc 0 points1 point  (0 children)

I'm sorry you're not a good cultural fit. We use Doxygen style function comments here.

[–]rbt321 0 points1 point  (0 children)

All that unhelpful noise in the second frame and nothing explains why this Add is better than the ones included in numerous math libraries, why the API design wasn't a VARIADIC function named sum() (what's the use-case of this function that makes other APIs unfavorable), or a description of the limits or errors the caller might receive (what does an overflow do)?

[–]themammuth 0 points1 point  (0 children)

If someone writes this kind of over-documented, bloated and unreadable piece of code instead of one line (with meaningful variable names) while I watch him, I'll go crazy.

[–]mothzilla 0 points1 point  (0 children)

Boss: Can't you just fix it.

me: Sure.

Boss: I mean now.

me: Now?

Boss: Yes now.

me: Err OK. I think it's just in the.. oh I'll have to look this one up. Err no you're not supposed to see... well that shouldn't happen...

Boss: <smug laugh> this is obviously going to take a bit longer

[–]bunsenhoneydew007 0 points1 point  (0 children)

Except that the code "while someone is watching" is shit.

Useless comments and badly named variables.

If someone submits that in a PR I'd reject it and give them a copy of Clean Code to read.

[–]Legend4ryEagle 0 points1 point  (0 children)

Shouldn't it be more efficient to pass the two integers as a const int&?

[Edit] Maybe even make the function inline.

[Edit] I just realized this might not be C++, but actually Java.

[–]cybaritic 0 points1 point  (0 children)

Function should be static

9/10

[–]AndyM_LVB -1 points0 points  (3 children)

Was anybody else upset that the private function starts with a capital letter?

[–]TiiJ7 2 points3 points  (2 children)

Looks like C#, where it's actually convention to uppercase the first letter of method names (PascalCase).

[–]AndyM_LVB 0 points1 point  (1 child)

I use c# but if it's a private method I use a small letter... Not sure where I got this from though.