News for hackers. Stuff that matters.
Re:Um, I have a question (about programmer productivity) by gruseom on Thursday February 12, 2009 @10:50PM (#479398)
Programmers know when they've been more productive because they feel it. This is not the kind of measurement that is accessible to metrics and formal studies, but that doesn't mean it isn't real. It does mean that the measurer and the measured have to be the same person, or people working closely together.
Re:Um, I have a question (about programmer productivity) by jefffoster on Friday February 13, 2009 @04:35AM (#479656)
Programmers are often a very poor judge of productivity. I've seen many Java programmers say they've had a productive day, but then I find they've typed 1001 getters/setters and intricately JavaDoc'd them. This is productive typing practice, but little more. In a similar vein, it's easy to feel productive if you're doing refactoring all day, but what has this actually achieved?

One aspect of TDD that isn't often quoted is that it helps get a concrete measure of productivity (and it's one of the themes of Beck's book). If you can see that today you've knocked out 100 tests, that's some measure of progress. It's a running theme through agile-processes. Small iterations / stories / code changes with measurable outcomes.

Re:Um, I have a question (about programmer productivity) by Tichy on Friday February 13, 2009 @05:50AM (#479711)
Then again writing tests can be just as unproductive as writing getters and setters. Maybe that is one reason that it has become so popular (makes you feel more productive)?
Re:Um, I have a question (about programmer productivity) by baseonmars on Friday February 13, 2009 @08:19AM (#479813)
I think the hope is you write one test then write the code to make it pass. In theory the code and tests grow at a similar rate. If one treats the two activities as separate then i think it would be very easy to get caught up in the productive feeling that writing tests gives without receiving a good portion of the benefits.
Re:Um, I have a question (about programmer productivity) by weavejester on Friday February 13, 2009 @08:58AM (#479838)
It seems to me that people's measure of productivity is relative. For a Java programmer, typing in 1001 getters and setters might be quite productive, at least compared to their typical day. For more sophisticated programmers, sure, it sounds like a waste of time, but perhaps that's because they have a higher average productivity.
Re:Um, I have a question (about programmer productivity) by kragen on Friday February 13, 2009 @10:20PM (#480795)
Maybe writing the JavaDoc helped them think out some design issues? Some of my most productive programming time has been sitting in a park with paper and a pencil. (Not billable, though, sigh.)
Re:Um, I have a question (about programmer productivity) by raganwald on Thursday February 12, 2009 @11:10PM (#479421)
So...

We can't quantify it or inspect it. We can't corroborate it. We can simply ask a programmer whether they are productive or not and trust them to answer for themselves.

And if Alice meets Bob on the street and they disagree over what makes them productive, there is really no way to settle the question. If Alice says she is more productive using Ruby than Python, but Bob says the opposite, we must trust that they are both right, and furthermore we can't really draw any conclusion.

Because Charles may report that he is more productive with Ruby, or Python, or perhaps Arc, and again he is the only one who knows.

Re:Um, I have a question (about programmer productivity) by prospero on Thursday February 12, 2009 @11:38PM (#479448)
It's an unsatisfying conclusion, but is it really all that surprising? To coin a metaphor, a programming language is a shoe; only you know if it fits right. It might stretch out and become more comfortable over time, but it's not a debatable point that it's pinching your toes.

Programming isn't a natural mode of thought, and programming languages aren't a natural mode of expression. I think it's unrealistic to expect that we'll ever find a universal best practice.

Re:Um, I have a question (about programmer productivity) by raganwald on Friday February 13, 2009 @12:47AM (#479501)
I should also point out that I agree with your statement that it's unrealistic to expect that we'll ever find a universal best practice. However, I also believe that is orthogonal to the question of whether productivity should be measured or not.

Imagine that productivity was as simple as bug-free function points per iteration. In this hypothetical case it's entirely possible that Alice is more productive in Ruby and Bob is more productive in Python, and we can measure the productivity.

However, the problem as given is that we don't even know that Alice produces more in Ruby or Bob in Python. All we have is their subjective assertions. That is the question I have: What are Alice and Bob talking about, and do we even know whether there is a correlation between their self-diagnosed productivity and anything useful we can measure like project success?

I don't think so. Consider Charles the Arc programmer and Debbie the PHP programmer. They work on identical Ruby projects for the same amount of time.

Charles reports that he was horribly unproductive using Ruby's brain-damaged implementation of half of Lisp. Debbie reports she was way more productive in Ruby than she ever was in PHP.

But in reality, Charles accomplished far more using his knowledge of Lisp, while Debbie spent most of her time learning how a truly dynamic language worked. Nevertheless, she felt "flow" and "freedom" while learning Ruby.

Can we trust their self-diagnosis? According to them, Debbie was more productive than Charles.

Re:Um, I have a question (about programmer productivity) by SapphireSun on Friday February 13, 2009 @01:08AM (#479525)
I think the reason finding good measures of productivity is because of some inherent properties of math. If a programmer sits and thinks for a bit, they may find a more (time/speed/memory) efficient way to implement something in fewer lines of code. The complement to that is that they might just implement something really fast in a brain dead way. Because these are mathematical algorithms, the various rules about provability apply.

Really, the only way to measure programmer productivity is how fast they can implement a perfectly detailed spec. If you have some unknowns in there, your measurements will tell you nothing.

Therefore, I might suggest a test whereby two programmers are told to implement a program with a spec that is completely known, in the same language, and with the same set of libraries, in their perfered (or an independently chosen ) working environment. What this comes down to is just a race, and some people have good days, and some have bad days.

If you run this test several times with different specs, you might be able to objectively tell whom is better given those environmental characteristics. Of course, these measurements will be nearly useless in a real project environment for the reasons cited in the first paragraph.

Re:Um, I have a question (about programmer productivity) by yason on Saturday February 14, 2009 @02:52AM (#480950)
Implementing a perfectly detailed spec isn't really programming per se. It's more like merely translating or codemonkeying. I think that having significant unknowns in there is an inherent part of programming, and the actual cases that don't are either rare or ridiculously trivial.

And it's pretty hard to quantify any unknowns. Somebody said that programmers do know when they're productive. I know when I am and that's basically whenever I write anything at all that I _know_ will contribute to the functional or algorithmic completion. Merely that constitutes productivity!

That means I know that "if I keep doing this I will finish the program at some point". Writing boilerplate doesn't count. If I keep slamming getters, setters, and a like into my source file twelve hours a day it won't make the actual program ever ready. All I'm typing in are effectively prerequisites.

Boilerplate doesn't count even if it's mandatory in the language I'm using: I'm not sure if I could ever feel productive with Java eventhough I know I would really, really have to write a hundred setters/getters in order to finish. The logical step that would make me productive on my own scale would be to scoop power from a better language.

Re:Um, I have a question (about programmer productivity) by jwilliams on Friday February 13, 2009 @01:37AM (#479555)
However, I also believe that is orthogonal to the question of whether productivity should be measured or not.

You're correct, as taking that to it's end conclusion would imply it's impossible to improve (which I'm sure most would disagree with).

Perhaps the question "How do you measure improvement?" is relevant. This might be a roundabout way to yield the former.

Re:Um, I have a question (about programmer productivity) by raganwald on Friday February 13, 2009 @12:06AM (#479469)
Your simile is what disturbs me: Often when programmers describe their productivity they are really describing their comfort level while carrying out programming tasks.

However, when we use the word "productivity" in every other aspect of business, we are describing the production of output. We don't measure how the output is produced, or the subjective feelings of the producers.

So what output are we discussing when we talk about productivity? Or are we using the word in a special way that has nothing to do with productiviy as it is used elsewhere?

Re:Um, I have a question (about programmer productivity) by prospero on Friday February 13, 2009 @01:26AM (#479546)
Point taken on the simile. It's like that like never existed.

As to the rest, I dunno. Let's consider the following scenario: every time you wrote something down on paper, there was a chance the paper would spontaneously burst into flame. There are strict, reproducible rules governing when the paper would and would not catch on fire. People go to school to learn these rules, which are varied and subtle.

In this world I've described, is the best writer a person who can write the most essays that don't spontaneously combust? I feel like as programmers we think that because we can easily quantify whether something works, we can also quantify whether it's good. Or worse, that everything which doesn't burn away is essentially the same: just words on paper.

It's simply not true. The fact that writing a program feels more practical than writing a novel doesn't change that.

Re:Um, I have a question (about programmer productivity) by yason on Saturday February 14, 2009 @03:29AM (#480966)
If there are two programmers and they both produce exactly the same output, but the differences are as follows:

The first programmer has spent a lot more time in doing it (like 5x the second programmer) and carefully verified each line to make sure the code and algorithm are correct both conceptually and in practice, and tested that the code won't fail in any of the imaginable corner cases.

The second programmer wrote it over the weekend, didn't test much else but merely cross-checked the code with a few working test cases similar to what the program will be used with for starters. He maybe followed his intuition to guide how to write or let his creative flow dictate the details of the program but he really hasn't had time to verify why.

There seems to be no clear notion of which programmer was more productive. It all depends on what perspective the project is viewed. On the other hand, I believe there's always some absolute value underneath and productivity isn't entirely an subjective property.

(Mandatory car analogy: If you want a Trabant and I sell you a Mercedes-Benz for the price of a Trabant and you still treat the car like a Trabant, the Mercedes is still better built regardless of how you extract value out of it.)

When the project was deployed, both programs worked correctly as they are similar. The cost per line/token of the first programmer is five times the cost of the second programmer. On the other hand, had the second programmer undergone the same rigorous verification it would have taken 2x the time of the first programmer.

Apparently the first programmer's code has a lot more value simply in being well-thought, and the programmer knows exactly why he has arrived in the solutions he wrote in the code. If the code broke the programmers would be on very different levels with regard to how to start debugging. On the other hand, the second programmer produced the same program in 1/5th of the time which may greatly please the management. However, the second programmer might easily become a grand failure in the next project as in this project he already reached the same solution if not by accident then at least by luck. Both programmers produced the same comments as they wrote it mainly for the future maintainers, as usual, instead of as a record of the whole mental process they experienced.

Re:Um, I have a question (about programmer productivity) by dmoney on Friday February 13, 2009 @04:00AM (#479637)
If it's possible to measure whole project success, at least it should be possible to see whether that is correlated with programmers' reported comfort levels (or some other reported emotional state, like excitement or fear).
Re:Um, I have a question (about programmer productivity) by harpastum on Thursday February 12, 2009 @11:53PM (#479458)
I agree that it is impossible to quantify productivity, but I believe it is not only possible, but _essential_ to inspect it.

I like to think that most programmers enjoy being productive, and strive for increased productivity (rather than working just for a paycheck). I therefore also believe that programmers expend great effort over the course of their careers optimizing their work habits to maximize productivity.

All programmers are different, but none of us is completely different from all others. There is much to be gained from examining what the others have learned in the process of programming. The danger in this is thinking that there is some objective Truth in programming productivity.

So, Bob disagrees with Alice over what makes a programmer productive. Assuming both Bob and Alice are effective programmers, what we should really be examining are the ideas they have in common.

For me, reading programming blogs from around the Internet gives me a giant mental Venn diagram--the ideas in the center are what I focus on.

Re:Um, I have a question (about programmer productivity) by whatusername on Friday February 13, 2009 @12:08AM (#479471)
sure we can quantify it.* Give Alice and Bob the same task. See who can do it faster / better. (obviously better can apply on multiple levels - but the tasks should clarify that. Performance, errors, scaling, maintenance, etc)

At the end (maybe of 12 months to allow for maintenance) you'll have a quantifiable result saying that Bob is more productive than alice.. (for that task - and probably tasks like it)

* I didn't say that it was easy or that we should spend that much time on a pissing match.

Re:Um, I have a question (about programmer productivity) by gruseom on Friday February 13, 2009 @02:21AM (#479584)
It sounds to me like what you're saying is that it's easy to measure productivity, all we have to do is measure quality. :)
Re:Um, I have a question (about programmer productivity) by JesseAldridge on Friday February 13, 2009 @03:21AM (#479616)
Yes, we do need to measure quality. And maybe a simple metric wouldn't work, but a skilled programmer should be able to hold two results up side by side and judge for himself which is better.

Controlled experiments with human judges seem like the best answer.

Re:Um, I have a question (about programmer productivity) by gruseom on Thursday February 12, 2009 @11:27PM (#479438)
You're jumping to conclusions. I'm not saying this is the only possible measurement, I'm saying it exists and has some properties and not others. The absence of more "objective" measurements does not mean that programmers are talking nonsense when we discuss our own productivity. I think it is probably true, though, that the nonsense ratio tends to go up when we start discussing the productivity of others. That should tell us something.
Re:Um, I have a question (about programmer productivity) by jerf on Friday February 13, 2009 @12:34AM (#479491)
It's like intelligence, or obscenity, or justice. The more you try to define it, the further it slips away from you. If you think you've got a universally-agreeable definition, you're wrong.

But you know it when you see it. (Even if somebody else might not agree.)

What are you gonna do? All the halfway interesting concepts in life work like that.

Re:Um, I have a question (about programmer productivity) by biohacker42 on Friday February 13, 2009 @10:13AM (#479910)
I am not sure that we can't quantify it.

Who's really tried?

There's been a few research papers here and there, measuring the things that are easy to measure in a corporate environment.

But who has both the incentive and the skills to measure a very difficult to quantify subjective experience?

It is absolutely a very complex subjective experience, but it ain't magic.

It IS very had to measure but it's not impossible just because no one's really tried yet.

Re:Um, I have a question (about programmer productivity) by skawaii on Thursday February 12, 2009 @11:24PM (#479434)
Could it be that productivity differs for each person? Maybe we can't have a productivity scale that is the same for everyone? Maybe it has to be applied personally?

But then again, maybe if we drill down deep enough, we'd find common themes or aspects for why Alice feels more productive with Ruby and Bob with Python.

Re:Um, I have a question (about programmer productivity) by akeefer on Friday February 13, 2009 @04:03AM (#479638)
In my experience, programmers think they know when they're being productive, but they're often wrong: for example, coding for 5 hours straight without realizing the time has passed might feel productive, but if you've been doing the wrong thing, or writing buggy or hacked-up code that will cost you in the long run, you probably haven't been nearly as productive as you think you have. Likewise, I often feel totally unproductive when pair programming, because everything feels slow and I'm not just cranking on something, but if I try to think about it objectively it's often the case that I get more done in that time by avoiding mistakes, finding better ways to do things, and by only doing the minimal necessary work. Similarly, to the point of the article, productivity of a team is a different metric than productivity of an individual: interrupting me might cost me 15 minutes of work, but if it saves someone else two hours of wasted work it's a big net win for the team.

That's not to say that programmers have no clue, just that our internal radar isn't exactly infallible. People tend to feel "productive" when they feel like they're "getting a lot done," but real productivity depends on whether you're doing the right things and whether you're doing them well.

And, let's face it, most programmers (myself included) really enjoy that feeling of just cranking on something and becoming so engrossed that they don't notice time pass. So I think that people are biased towards thinking that always corresponds with maximum productivity simply because it's enjoyable, and not because it's truly always optimal.

Re:Um, I have a question (about programmer productivity) by brianto2010 on Friday February 13, 2009 @05:13PM (#480530)
> In my experience, programmers think they know when they're being productive, but they're often wrong.

So true.

http://www.geekherocomic.com/2009/01/19/efficiency-and-compr...

> That's not to say that programmers have no clue, just that our internal radar isn't exactly infallible. People tend to feel "productive" when they feel like they're "getting a lot done," but real productivity depends on whether you're doing the right things and whether you're doing them well.

So, is it safe to say that if you 'feel productive', you're most likely not?

Re:Um, I have a question (about programmer productivity) by adamc on Friday February 13, 2009 @07:56AM (#479790)
I agree that this is really what a lot of people are probably discussing -- how they feel, whether they are in the zone. The interesting question is whether it really corresponds to getting stuff done. Solving interesting problems in new ways often puts me in that zone, but I'm not clear that such solutions necessarily buys the organization more.
Re:Um, I have a question (about programmer productivity) by BigZaphod on Friday February 13, 2009 @09:27AM (#479857)
I usually feel like I've been productive if I spent most of the day in the zone - but the truth is, that doesn't always move things in the right direction. For instance, I might suddenly obsess over some little visual detail that I want to get just perfect and end up spending an entire day on it. At the time it feels right - but looking back later when the project is behind schedule and everyone's in crunch mode, I have to wonder if that was really a productive day or not...
Re:Um, I have a question (about programmer productivity) by trapper on Friday February 13, 2009 @12:48AM (#479502)
Someone hasn't read the excellent book "how to measure anything".
Re:Um, I have a question (about programmer productivity) by jon_dahl on Friday February 13, 2009 @11:15AM (#480001)
Don't forget the Dunning-Kruger effect. Mediocre programmers may feel productive when they get some nominal feature working, while great programmers may feel unproductive even though they've accomplished a lot.
Re:Um, I have a question (about programmer productivity) by access_denied on Friday February 13, 2009 @03:17AM (#479612)
I think part of the "feeling" is knowing - internally - how much you have learned during that particular programming session. How much did you produce is one thing, but how much did you improve you capability to produce more another.