Slashdot Mirror


It's Not About Lines of Code

Charles Connell writes: "What makes a programmer highly productive? Is it lines of code per day? Lines of good code? In this article, I examine the concept of software productivity. I look at some of the standard definitions for productivity and show why they are wrong. I then propose a new definition that captures what programming really is about." Read on for Connell's stab at a better way of evaluating the worth of programmer time. CT Originally the contents of an article were here but there was a communication problem resulting in us thinking we were given permission to print the article here. Now that things have been cleared up, we've linked the original article which you can read instead. Sorry about the inconvenience.

500 comments

  1. Classical measures of productivity by T5 · · Score: 5, Insightful

    They just don't apply to this art/science. Would Michelangelo's boss have put him to task for square inches/day or pounds of statue/week output?

    1. Re:Classical measures of productivity by beebware · · Score: 1

      Actually, that's quite a good similarity. Programmers, are in a way, artists. We think of what we achieve and then we set out to achieve that goal using our own special skillset and 'signature' (I've got 4 programmers in my team and I can match up a chunk of code to any other them - include 4 predecessors).

    2. Re:Classical measures of productivity by Sc00ter · · Score: 5, Insightful
      If I requested a statue of say, myself, I would expect a completion date. He should be able to figure out how long it would take to finish a statue of somebody my size. Equally he should beable to finish a painting of a subject that's been selected prior to him starting his job. Just as a programmer should be able to estimate how to finish a project if he knows what's involved up front. Of course this isn't exact, it's within a few days or weeks, but there should be a ballpark figure, also, changes to the design should be expected to set things back.

    3. Re:Classical measures of productivity by ackthpt · · Score: 4, Funny
      Why programmers get grey hairs:

      "I need you to be great and create something totally fantastic and immensely profitable by Friday, Can you do it?"

      Why programmers consider murder:

      "What's taking you so long? I've already built something just like it in Access."

      Why programmers retire early:

      "We're totally bankrupt, you probably didn't work hard enough. Thank goodness I've got a golden parachute."

      --

      A feeling of having made the same mistake before: Deja Foobar
    4. Re:Classical measures of productivity by ivan256 · · Score: 5, Interesting

      Yeah, that's great, but what manager works like that? No manager would ever say to me "John, how long would this take you?" for a project with a 6 month or 1 year time frame, and then leave me alone for 6 months while I write code. Managers want progress reports and statistical measures to reduce the risk that that they might get fired when the project they're managing fails. That's where the boneheaded requests for the "number of lines of code you've written this week", or "number of bugs you've fixed this week" come from. It's hard to look at an unfinished piece of software and know how it's coming along, but it's easy to look at a painting or a statue that's in progress and see work being done.

    5. Re:Classical measures of productivity by roman_mir · · Score: 2

      Leonardo spent a total of 20 years on Jaconda, he never actually finished it and this painting is considered to be a work of genius and costs millions... I think Mona Lisa was an average sized person (no matter who she or he was) by your definition Davinci should have being able to correctly predict the amount of time it took to do. (In this case, Leonardo was the customer) So what was that you said about productivity?

    6. Re:Classical measures of productivity by Zen+Mastuh · · Score: 2

      No! Creatitivity can not be compelled. The parent post spoke of Michelangelo, so you should do some research before replying. Read The Agony and the Ecstacy for a better--although fictionalized--insight into the life of an artist.

      --
      "What is the sound of one belly slapping?"
    7. Re:Classical measures of productivity by Anonymous Coward · · Score: 0

      This information might be old news to some of you, but usefull old news has to be reposted once in a while. Some people do not know these concepts yet and they might find it very usefull.

      Note: id login but I havent gotten my password yet. deesdee@notme.com

    8. Re:Classical measures of productivity by Wizul · · Score: 2, Interesting

      I can related well to this article because of a past job experience. The job was software developement for a large corporation, in an office setting. The dept was devided into different teams and each team worked on different features of the same major project. To my manager it looked like I was coming in late, leaving early and not doing a whole lot to be productive around the office. What actually was happening was that I wasn't able to be as productive in the office setting. I would copy what I working on to a floppy and take it home to work on it. After waking up in the morning, more ideas came so I went ahead and put them in, making myself late in the process. The features I was working on was completed on time, despite having to wait for others to get done with their part. Always tried to write code efficiently and with as few lines a possible, with good comments and white spacing. Despite all my efforts, I was given a less than average performance review. I got chewed out for leaving early and put on a peformance improvement program (which happens to be very close to being fired) and means you don't get a raise or bonus. There needs to be some measure of performance for programmers but it should really be about getting the job done to the customer's satifaction and within a reasonable time frame. Hours spent in the office, lines of code and all the other bullshit management uses should be as considered secondary measurements at best.

    9. Re:Classical measures of productivity by scott1853 · · Score: 3, Informative

      "It's hard to look at an unfinished piece of software and know how it's coming along"

      That would depend on the development method and the actual product being developed. If you're developing APIs or libraries for other people to use, then you really can't "see" how far along it is, although you could count function or components complete. However, if you're developing something like a website or a client application, then you can see how far along things are though.

      Of course I completely agree with measuring lines of code being boneheaded, unless of course the number of lines of code for the final product is known before it starts. Luckily I work with people that understand that numbers are irrelevant, and that the product won't be finished until long after it has been released to the public.

      As far as an ideal solution, give the managers the convoluted formula of computing productivity that results in an answer that only slightly deviates from a standard amount. That way at least they'll stay out of your hair long enough to get some coding done.

    10. Re:Classical measures of productivity by Anonymous Coward · · Score: 0

      This all gets down to how much is known beforehand, and the variability to produce something. If you are mass producing something in a factory, not only do you known all the steps in manufacturing it, but you also can measure the process.

      At the other end of the scale is embarking on something where much is unknown. Would you expect a research group to put a schedule on curing cancer? Of course not. Not only is there much we don't know, we probably don't even know how much we don't know.

      The need to be creative is probably a major contributor to variability. If Michaelangelo was told he had a deadline to complete something, he would have to reduce risk by reducing variability. This might result in all of his paintings and statues looking alike, and would probably have prevented his best work from being attempted.

    11. Re:Classical measures of productivity by Darth_Burrito · · Score: 5, Insightful

      To: Mike
      Memo: Design Revisions
      We want corporate statue to have the head of a St Bernard and the torso of a gopher. Can you throw in a couple of extra arms while your at? 4 or 5 should be enough. Need to move the schedule up while we're at, investors will be visiting in two weeks and we need something to show them.
      Thanks,
      Management

    12. Re:Classical measures of productivity by medcalf · · Score: 2
      a programmer should be able to estimate how to finish a project if he knows what's involved up front.

      Depends on whether your are producing new code or debugging old code. Testing and debugging are open ended, since, as my friend Dave asks, "How long is a piece of string?"

      --
      -- Two men say they're Jesus. One of them must be wrong. - Dire Straits
    13. Re:Classical measures of productivity by Carpathius · · Score: 1

      I disagree. If it were simply a craft, then anyone with a reasonable amount of intellegence could learn to code well and quickly.

      Programmers -- *good* programmers -- know the craft of programming, but are also able to do more then someone who is simply a craftsman. The best programmers do create art of a form.

      It's the same as in many things that are considered 'art'. Anyone can go to school to learn how to write music, and will learn how to write well formed and competent pieces. The people who are good, go further and begin to create art within the music.

      Most people can learn the craft -- the *language* of a vocation, whether it be music, painting, sculpting, or programming. But art comes to only the truly talented.

      With programming, it's often difficult to recognise the art that went into the application. So often the true artistry is in the internal design and can't be seen externally unless you truly know where to look. But it can be there. As programmers, we talk of 'elegant' solutions to problems -- obviously there are those solutions which are not so elegant. If a solution is truly elegant, why can't it also be art?

      Sean.

    14. Re:Classical measures of productivity by Anonymous Coward · · Score: 1, Insightful

      If the specs include a test suite, you can get a fairly accurate picture of how far along a project is by the number of tests which pass successully. That is of course assuming that the unit tests are fairly consistant in the size of each piece of the peoject they test.

      This works really well for things like libraries or APIs but not so well for web sites or client applications. However you say that those sort of things are easy to see the reletive completeness so it's not an issue.

    15. Re:Classical measures of productivity by ConsumedByTV · · Score: 3, Interesting

      I do not disagree with you and to add to your point:

      To create a tool for use with art (say a paint brush) in itself is a craft, but to make a beautiful styled handmade 'one of a kind paint brush' with your skills certianly takes you out of the relm of just a simple craftsman. I would think that photoshop is the 'one of a kind brush' and 'paint' is norm in the craft.

      --


      "Not my manner of thinking but the manner of thinking of others has been the source of my unhappiness." - M
    16. Re:Classical measures of productivity by Penguin · · Score: 1

      Actually Charles Dickens was paid per page.

      "Oliver Twist" might have looked somewhat different.

      --
      - Peter Brodersen; professional nerd
    17. Re:Classical measures of productivity by richieb · · Score: 2
      Actually didn't the Pope say to MichaelAngelo - "I thought you were going to paint it blue".

      --
      ...richie - It is a good day to code.
    18. Re:Classical measures of productivity by DrSpin · · Score: 2, Insightful

      Its a lot easier to look at the code and see it being tested and tell how well its progressing if you have programming experience, than if you were hired cos you have a degree in "Human Resource Management" or have an MSCE in using Microsoft Project".

    19. Re:Classical measures of productivity by rusty+spoon · · Score: 3, Interesting

      If managers want a measure of progress then the team should know this.

      "Percieved" progress and "actual" progress can vary. A prototype can give a lot of percieved progress but no (hopefully) actual progress.

      80-20 rule always kicks in when trying to measure progress. I've known developers who manage to keep their project 90% complete (yeah, you know who you are) for a very long time.

      I prefer having an almost constantly shippable product from the outset. It's difficult to achieve early on but it can be done very soon with basic functionality.

      It also provides a good way to test design and implementation. Aim to get something working within spec. asap and everyone will be pleased.

      It also provides a good measure of progress. Ticking features off a list reassures the managers and gives a good boost to the team. Admittedly it's not possible for some projects with lots of core features needed to be built from scratch.

      Should the shit hit the fan (like a competitor doing a release) then features can be dropped and the product shipped much quicker. It means renaging on some promises made to customers but if you have been open and honest with them they'll understand, also, if you release early/often they don't mind waiting for X if the have Y.

      You've just got to keep an eye on the team, harass them for quality, and reward excellence.

      My measure of productivity is based on delivery of code/features that falls within my quality guidelines. This includes lack of bugs, code layout, comments and reuse. e.g. A feature can be 'working to spec.' but if it has no comments in the code then it's not 'finished'.

      I also know developers that quickly write the code, do all the testing and then call the feature finished. They then go back and add comments, correct variable naming and touch the code in other ways (adding whitespace, reoganising if's) - they fail to realise that they now need to perform all the same tests again, which of course they never do. This is *low* productivity IMO and is generally poor style.

      Coding *is* art and I am an 'artished'.

    20. Re:Classical measures of productivity by Skyshadow · · Score: 4, Funny
      Well, in fairness, there's a good reason why you can't just leave a developer to go on a six month project.

      This is why the iterative development method is useful -- you set a certain number of things you want to see done by such-and-such a date (best done with the interaction of the developer), then if it's not done the developer better have a good reason.

      This approach works on most development projects (with the possible exception of very new projects with no existing product) and only when at least the lower level managers understand the development of the project and can participate in setting the goals.

      Oh, and here's the big secret: then you build on an extra 15 days for every six months of the project and don't tell anyone involved with the development. That way, you look like a hero if it gets done in time and don't lose your job if its not. Don't tell anyone.

      --
      Every year during my review, I just pray the words "slashdot.org" aren't mentioned.
    21. Re:Classical measures of productivity by stephanruby · · Score: 2, Funny
      If I requested a statue of say, myself, I would expect a completion date. [...] Of course this isn't exact, it's within a few days or weeks, but there should be a ballpark figure, also, changes to the design should be expected to set things back.

      Mamamilla! He wants me to do what!!!!
      - Michanlangelo

    22. Re:Classical measures of productivity by ivan256 · · Score: 2

      I'm working on a project right now. It's a OS kernel layer. The schedule is written exactly as you say. Get a shipable product right away with a minimal feature set, and then add features. The trouble is that it would have taken me just as long to write the entire product as it is for me to write each of three feature checkpoints* (I've completed two of them at this point). The feature completion dates were written even before I had completed the design (the design document was the first date). Be careful with your method. Decisions about scheduling feature completion dates cannot be made by people without intimate knowledge of a design.

      Also, managers that require complete retesting after whitespace/comment changes piss me off. It's not always possible to document how you're going to do something as you do it. The subtlties that you want documented in comments come out during the implementation, not during the design. Commenting after the fact (to augment existing comments) is a necissity for creating good documentation. If the change doesn't affect the binary output of the compiler then you don't need a compete retest. I have worked with companies where I've had to prove to them that the text section of the binary was identical in order to prevent a restart of the 3 month testing cycle (and delaying the arival of my check :), but I've also worked with companies where no argument I made would convince them that nothing has really changed even though I added documentation. It's managers like that who encourage people to not do the extra documentation work at the end of a project.

      *(BTW, I couldn't just implement all of the features right away and finish early, some of the check points include manual invocation of features that are supposed to work automatically. Since in the final version there is no provision for causing certain events manually alot of extra work had to be done to make that possible. Much of that code has to be removed, and is wasted, becuase manual invocation of these features would cause undesierable results in the final version.)

    23. Re:Classical measures of productivity by Kailden · · Score: 2

      ...changes to the design should be expected to set things back....

      THIS IS EXACTLY what makes most large projects unestimatable! You can give all the dates you want but to completely implement a new system---you will always have requirement changes! Ask any of these companies that have SAP come in and replace their core accouting/planning/reports systems and why they end up scrapping the project because it takes three times as long as what they thought (costs 10x as much in lost opportunity) and they still can't customize it like when they had a local IT shop!

      If you understand some basic mathematics, take a look at these two links and your eyes will be opened!!
      Large Limits to Software Estimation

      and for a background on randomness

      A Century of Controversy Over the Foundations of Mathematics

      This is good stuff!

      --
      I need a TiVo for my car. Pause live traffic now.
    24. Re:Classical measures of productivity by ivan256 · · Score: 2

      I don't expect to be left alone for 6 months. What I'm trying to say I guess is that the best way to get an acurate measure of how engineers are progressing is to have the project managed by an engineer. I'm also a big fan of having sales contracts for custom engineering work reviewed by the engineers before it's signed. I've seen too much dumb shit agreed to in custom engineering contracts, and for too little money. (You can't pay me enough to break the laws of physics, or to say, support USB on a device with no USB hardware).

    25. Re:Classical measures of productivity by loydcc · · Score: 5, Insightful
      If I remember the story correctly... The Pope wanted Michelangelo to send his portfolio for consideration before giving him the Sistine Chapel. Michelangelo drew a circle freehand on a slip of paper and sent it off with a courier. The pope was insulted and sent the courier back with an admonition to send a real portfolio. Michelangelo sent the circle back. The pope then traveled to confront Michelangelo. Michelangelo's response was something on the order of the circle is perfect. If he could do better freehand he should do the whole ceiling his own damn self.

      What this has to do with software is sometimes the customer doesn't know what they want. Sometimes management has to trust the artist. And sometimes the amount of work is less important than the quality of work.

    26. Re:Classical measures of productivity by ichimunki · · Score: 2, Insightful

      That's funny, when I was in art school, nobody there had any trouble being creative in our 13 week quarters, going from no work done to small, consistent portfolio in that time. In fact, I often myself most productive if I kind of toyed with various themes or ideas and then really hammered them home later in the quarter, usually leaving me just enough time before final critique to get the stuff mounted and ready for a real display.

      My programming often works the same way, if I let parts of it percolate for a while I usually think of something better than I would have if I'd just spent the time banging away at it. I'm not disputing that the two disciplines can be similar, only that creativity cannot be compelled. It's all about problem-solving, and it just may be that a little added stress *helps* the brain do that stuff. The same way an adrenaline kick helps athletes out.

      --
      I do not have a signature
    27. Re:Classical measures of productivity by chaumu · · Score: 1

      Managers want progress reports and statistical measures to reduce the risk that that they might get fired when the project they're managing fails

      That's why you don't use lines of code or some other idiotic metric to measure progress. The developer should produce a list of fairly fine grained achievements (broken down by week) that will lead to the finished product. This way the programmer determines the approach they're going to take and also the means by which progress will be measured.

      Also, inevitably with larger projects there are dependencies which have to be tracked throughout the execution. Ingrid needs the foobar API, but it's not scheduled to be complete until it's too late for her, etc...

    28. Re:Classical measures of productivity by Philbert+Desenex · · Score: 2

      If I requested a statue of say, myself, I would expect a completion date. He should be able to figure out how long it would take to finish a statue of somebody my size.

      You've never worked with an artist before have you? I say this with only love and affection for them, but artists cannot schedule in advance, and cannot meet agreed-upon deadlines.

      That's why they're artists rather than assembly-line workers, that's why they're artists rather than small business people. The nature of art and artists just doesn't mesh well with schedules and deadlines.

    29. Re:Classical measures of productivity by Axe · · Score: 1
      He actually would. When you are painting a whole cathedral, especially in fresco style, you better be very well organized and efficient.

      I have a number of friends in arts. Their level of organization, planning and business/customer relations is above that most of my programming friends. (I do both science and coding, so can not tell where do I fall in the classification.. ;0 )

      --
      <^>_<(ô ô)>_<^>
    30. Re:Classical measures of productivity by ivan256 · · Score: 2

      I'm not saying managers shouldn't want to gague progress. I'm saying it's the managers that pick the idiotic metric. Furthemore, it can be hard to break down achivements by week. Some projects can't be measured that finely, or worse, the week by week checkpoints will create extra work along the way. (see my reply to another comment in this thread for an example of this.) The aproach to measure progress needs to be decided on a per project basis after the design is complete. Using braindead monolithic policies to jedge project progress will get you nowhere alot of the time.

    31. Re:Classical measures of productivity by Anonymous Coward · · Score: 0

      Sounds to me like you're trying to make excuses for your ADD.

    32. Re:Classical measures of productivity by ichimunki · · Score: 1

      Ack. I meant to say that creativity *CAN* be compelled. Obviously not by brute force, but that sometimes the stress of needing to finish something can produce the desired "inspiration" that would otherwise be lacking.

      --
      I do not have a signature
    33. Re:Classical measures of productivity by IsaacW · · Score: 2, Interesting
      I disagree. If it were simply a craft, then anyone with a reasonable amount of intellegence could learn to code well and quickly.

      Programmers -- *good* programmers -- know the craft of programming, but are also able to do more then someone who is simply a craftsman. The best programmers do create art of a form.


      It is amazing how much people favor their own talents over those of others. Here you say that programming is something more than a craft. It is not. A craft is the knowledge to apply a set of tools to create something that is useful or beautiful. The art comes in applying that knowledge to create something superb within your field. Certainly not all programs written are art, but some of them could certainly qualify as such due to their elegance and novelty.

      The grandparent comment appears to have used the term artist synonymously with craftsman, and he is correct in doing so. Not everything an artist creates could be considered art. Only those works that speak some hidden truth beyond the surface of the medium, those that are truly beautiful, even if that beauty is not in an asthetic sense, can be called art.

      Furthermore, anyone with a reasonable level of intelligence CAN learn to code well and quickly, however just as there are painters and sculptors, there are the Michaelangelos. Some craftsmen will more fully develop their ability than others.
    34. Re:Classical measures of productivity by rusty+spoon · · Score: 1

      Sounds like fun but it sounds right to me.

      Changing code requires a re-test, doesn't matter whether you have moved a full-stop in a comment or whether you have re-engineered an algorithm. Remember that small changes are often smiple.

      It sounds like you have the ability to unit test so forced retests should be complete on a nightly build. It's how I'd do it.

    35. Re:Classical measures of productivity by someme · · Score: 1
      It's hard to look at an unfinished piece of software and know how it's coming along, but it's easy to look at a painting or a statue that's in progress and see work being done.
      If you solve rubik's cube by one popular approach you finish the first two rows (layers) first. The cube looks two-thirds finished. When continuing you go through a long pattern of turns that completely destroys the previously seen progress. At the end of these steps the final result suddenly appears and all the colors are in order.
      Sometimes in a project there are series of days in which no progress can be reported that is visible to a watcher outside. I think of that as these steps during solving rubik's cube.
    36. Re:Classical measures of productivity by Da+Masta · · Score: 1

      Dude, I wish I had mod access this week, and that there was no 5 karma limit. It's modded funny now, but god that strikes so close to home it's not funny.

    37. Re:Classical measures of productivity by ivan256 · · Score: 2

      Unfortunatly, the test plan in the situation I was refering to was not designed by me and involved a human component in each step. Retesting was labor intensive. Either way, my point was that if the text section of the binary hasn't changed, then the code hasn't changed. Period. It doesn't matter if the source files are different, the code that the machine is running is still the same and will produce the same test results.

    38. Re:Classical measures of productivity by yintercept · · Score: 2

      He should be able to figure out how long it would take to finish a statue of somebody my size. Equally he should beable to finish a painting of a subject that's been selected prior to him starting his job.

      This would be a nice ideal world. Unfortunatley, programmers spend most of their frustrating hours hashing on the unknowns. When you have a good statue generation program, then it is only a matter of executing it to create a statue of travis@scootz.net, but making that statue is the kicker.

    39. Re:Classical measures of productivity by Anonymous Coward · · Score: 0

      No, that was Giotto.

    40. Re:Classical measures of productivity by fferreres · · Score: 2

      The problem is when people think of software (or even digital stuff) as something specific. It's the most generic tool humans have devised after spoken language (english, etc).

      So how can you measure productivity when you don' t have a specific goal set. It could be anything, from solving cancer, to expesing art, to making a game (funny games, like leasure suit larry, or RPGs, etc) to guiding a nuke misile.

      The article is, in this sense, just plain ridiculous. I'd say anyway, that "productive" in the american sense is what earns you more than cost. And you can't know that in advance. In fact, you could very much destroy productivity when you start using fixed rules to judge productivity instead of using plain COMMON SENSE...

      Anyway, that's the way I see it!

      --
      unfinished: (adj.)
    41. Re:Classical measures of productivity by fferreres · · Score: 2

      Unreal (the game) took like 5 years to develop, and they thought it would take them 2 (or something like that). Of course, no company will let you spend 5 years making a game, unless you own it and raise the funds yourself.

      Productivity and dates are ok, but more importantly, what you'll need is inspiration, motivation, talent and a clear goal.

      --
      unfinished: (adj.)
    42. Re:Classical measures of productivity by MulluskO · · Score: 2

      If the manager had programming skills, perhaps he would be able to judge progress by looking at the code himself.

      --

      Too busy staying alive... ~ R.A.
    43. Re:Classical measures of productivity by nagarjun · · Score: 1

      Not all software modules are *not* masterpieces. Nor are they meant to be.

      Applying classical measures is not OK if some one is say, building an OS kernel from scratch. But if he is writing say, a "string compare" function, that's the programming equivalent of laying bricks in a kiln. Algo known, methodology known, so nothing very creative. Why shouldn't classical measures apply?

    44. Re:Classical measures of productivity by Peter+Harris · · Score: 2

      Anyone writing a "string compare" function is either a newbie, an idiot or working in the wrong language.

      OK maybe a bit harsh, but if something is already completely understood and has been done properly before: YOU RE-USE IT.

      Classical measures of productivity are based on manufacture of physical objects where to have two of something you have to make the thing twice. It's just not like that with software.

      --

      -- What do you need?
      -- Gnus. Lots of Gnus.
    45. Re:Classical measures of productivity by Amarok.Org · · Score: 1

      That Dave guy sounds pretty smart.

      --
      -- "Other than that, how was the play Mrs. Lincoln?"
    46. Re:Classical measures of productivity by medcalf · · Score: 2

      No, not really. :-)

      --
      -- Two men say they're Jesus. One of them must be wrong. - Dire Straits
  2. could this be possibly be more useless? by nsqtr · · Score: 5, Insightful

    Dude, buy a copy of DeMarco/Lister's "Peopleware", original edition is circa 1985. Your "revelation" is old news and you offer no substantive recommendations for actually helping management measure or actuate programmer productivity. The Peopleware book is factful and entertaining and reaches no better conclusion than you have. After 17 years, don't you think your postulations should improve on previous work. Have you done any research on prior publications?

    1. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0
      Agreed - the use of LOCs is usually considered a joke now.

      From the original blurb:
      Read on for Connell's stab at a better way of evaluating the worth of programmer time.

      Um, did I miss that in the article ?

    2. Re:could this be possibly be more useless? by FortKnox · · Score: 3, Interesting

      Beat me to the punch.

      This is old news, and if a manager is looking at lines of code produced, as opposed to general quality of the overall product, your manager is 95.

      I have yet to see a manager look at "lines of code" as any type of measurement.
      Has anyone?

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    3. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      YES! if slashdot started charging for it...

      um... wait...

      er, nevermind.

      (yeah, i know /. is free as in "whathaveyou")

    4. Re:could this be possibly be more useless? by phaze3000 · · Score: 3, Insightful
      I don't think the author ever pretended he was the first one to come up with the ideas he mentions in the article. Just because someone has already written a book along the same lines it doesn't make the article useless.

      Having said that, the fact that he offers no alternatives does make the value of the article questionable. But perhaps the point of the article was to raise ideas of how one could evaluate the amount of work done - and the author didn't want to bias this by suggesting a particular method?

      If so, then this is far preferable than an 'Ask Slashdot - how do I measure my programmer's productivity?'

      --
      Blaming GW Bush for the Iraq war is like blaming Ronald McDonald for the poor quality of food.
    5. Re:could this be possibly be more useless? by Amoeba+Protozoa · · Score: 5, Insightful

      I would argue that reiterating something that might not be common knowledge to everybody or perhaps even to one's self is not a waste of anyone's time. It can only help to raise awareness of a particular view on an issue that not everybody may have knowledge of.

      It is from constant retelling of an idea that the idea becomes accepted into culture and things begin to change.

      This is a good idea, so help spread the love man.

      -AP

    6. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      Just because somebody else has covered the idea in a book written *17 years ago* doesn't mean that it's not good to bring it up for discussion again. Perhaps his summary will spur thought and somebody will discover a better metric.

      Or perhaps some pointy-haired line of code mongering manager will read it and realize the error of his or her ways.

      Relax and cut back on the caffine.

      cfury

    7. Re:could this be possibly be more useless? by yintercept · · Score: 2

      After 17 years, don't you think your postulations should improve on previous work. Have you done any research on prior publications?

      Uh, it looks like this blurb was introduced as an item of discussion and not a research paper. I thought the blurb was cleaning written and succinct about an issue of interest to many /.ers. These observations are easy to deduce. The issue of productivity has been hashed by philosphers, economists and others for millinnea. Most of What DeMarco said 17 years ago was simply rehashing of others works.

      Economists generally define productivity as the amount of money that your product brings in compared to the hours you worked on it. In this case, the MS programmer who dropped a nasty bug in WinWord, and caused the MS faithful to spend a few billion dollars on the next WinWord release would qualify as the most productive programmer of the year.

    8. Re:could this be possibly be more useless? by stox · · Score: 2

      I would also recommend DeMarco's "Controlling Software Projects" along with "Peopleware" in regards to this line of thought.

      --
      "To those who are overly cautious, everything is impossible. "
    9. Re:could this be possibly be more useless? by CaseyB · · Score: 3, Funny
      Your "revelation" is old news and you offer no substantive recommendations for actually helping management measure or actuate programmer productivity.

      Huh? What are you talking about!?

      Now I suppose you're going to call the "Man-Month" measurement of a project's size some kind of myth!!

    10. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      Yes, actually, I have had to report lines of code changes for the previous project that I was involved with at my corporation.

      Also, there are goals related to code reuse (on the order of some percentage of the lines of code) for the current project that I'm on.

      So, there are managers who look at "lines of code" as a type of measurement out there, at least in large corporations.

    11. Re:could this be possibly be more useless? by pmc · · Score: 2

      If so, then this is far preferable than an 'Ask Slashdot - how do I measure my programmer's productivity?'

      I disagree - "Ask Slashdot" does not have a illusion (or possibly delusion) of authority. To have any sort of meaningful measure of productivity you must have something to measure - "ability to solve customer problems quickly" is not a measurable and cannot be used as a metric.

      The whole article was just woolly waffle. It is also a pointless definition as it is only applicable after the fact - "What software is about is solving the probelms for the people who will use the software." How do you know until it ships? What a manager wants is a metric that he can use to measure productivity during development - after the fact is useless.

      Oh - and the "should not lose site [sic]" in the last paragraph cheered me up too.

    12. Re:could this be possibly be more useless? by Bilestoad · · Score: 1

      Yes, but Charles must be congratulated. Although he had to resort to stating the fucking obvious, he did get his name on the front page of slashdot along with a link to his website.

      Now what do you think this "article" was really about?

    13. Re:could this be possibly be more useless? by gkirkend · · Score: 1
      I worked for a manager that used lines of code as his metric. He was an idiot, but he still signed my time sheet. I think it is fair to say that many IT managers have never been trained on how to manage people or software projects.


      Greg

      --
      To a shark, you are just another food choice...
    14. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 1, Informative

      OH MY DEAR GOD!!! This man did not provide us with any revelations or entire new ways of doing things!!! ....LETS BURN HIM!!! BBUURRRNNN HIM!!!

      you need to chill out... just because his idea was old doesnt mean you have to tear him a new ass hole...

    15. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      I actually once (years ago, and at a different company) had a manager use lines of code as a marketing metric, if anyone can quite believe it. He made up a slide showing the growth in lines of code in the product from release to release, as a way of demonstrating how much more functionality was in the product.

      Of course, any marketing organization that would buy into that deserves what it gets.

    16. Re:could this be possibly be more useless? by mizhi · · Score: 2

      More to the point, he is essentially talking about a metric; something that has been debated over and over in the software engineering community. Most have LONG since discarded this trivial metric and there are many other that give a somewhat more accurate idea of "productivity," such as defect density, etc. But that then asks the question, well, what do you mean be "productivity?" If you want just a bunch of code monkies banging away at keyboards, I'm sure we coudl arrange for some monkies to be chained up in the office! Sometimes, programmers don't even write code all day! They spend it doing research to help solve a problem... companies have got to get away from this notion that "volume-of-work = quality-of-work"

      --
      Humorless sig goes here.
    17. Re:could this be possibly be more useless? by Transcendent · · Score: 1

      Your "revelation" is old news and you offer no substantive recommendations for actually helping management measure or actuate programmers productivity.

      I did not see anywhere in the article the mention of this idea being a "revelation"...

      Why would this simple article actuate programmer productivity? Is he giving a lecture to programmers of a company, setting down new methods of measuring productivity that a company will now abide by and harshly judge with? Thank you for the obvious statement.

      ...I thought this article gave at least some grounds to measure the productivity of a programmer... isn't that what the examples were for?

      The Peopleware book is factful and entertaining and reaches no better conclusion than you have.

      So he reached a conclusion that is the same or better than what was reached in Peopleware... which took an entire book to get its point across.... whats more efficient? Is the point he was trying to make a little better now? heh

      Dude, buy a copy of DeMarco/Lister's "Peopleware", original edition is circa 1985

      ....why would he want to put money down to buy a copy of the book when he already knows the point of it? Is it really THAT entertaining?

    18. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      Yeah, he'll be really happy when he gets his monthly bandwidth bill...

    19. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      Dude, don't spite the author of this thing so hard, your comment comes off as quite the troll.

      Yeah, so his idea wasn't terribly original, and certainly far from perfect. So what? Truly original action is extremely rare, I'm willing to bet the number of times you or I or most any other /. reader does something truly original can likely be counted on your two hands (plus just maybe some toes).

    20. Re:could this be possibly be more useless? by Compinche · · Score: 1

      2nd. edition available at Amazon and reviews.

    21. Re:could this be possibly be more useless? by dar · · Score: 1

      Since when does being old news disqualify a Slashdot story?

      --
      My other Slashdot ID is much lower.
    22. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      I agree. Charles Connell doesn't deserve to be attacked for this. He was just whoring. Timothy is the one who deserves a new aperture for posting this kind of drivel.

    23. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 0

      Come on, Taco. Mod this guy up. Have you ever seen a more sincere Karma whore in your life?

    24. Re:could this be possibly be more useless? by Anonymous Coward · · Score: 1, Interesting

      The man-month is a myth. Didn't Steve McConnell debunk it in "Brooks' Law Repealed?".

      http://www.construx.com/stevemcc/ieeesoftware/ei c0 8.htm

    25. Re:could this be possibly be more useless? by voncheesebiscuit · · Score: 1

      Agreed.

      Always get annoyed when a writer spits out an article that attempts to solve a problem, basically points out the obvious, and ultimately says "Well, its hard to figure out, everyone has to decide for themselves".

      Duh. Could you be less insightful?

  3. Evaluation: by L-Wave · · Score: 3, Funny

    They should evaluate programmers by the length of thier beards. =)

    --
    I SURVIVED THE GREAT SLASHDOT BLACKOUT OF 2002!
    1. Re:Evaluation: by Aiku1337 · · Score: 0, Offtopic

      or inches on their waists? ;)

    2. Re:Evaluation: by Anonymous Coward · · Score: 0

      both of those are not fair. i dont have a beard, and have a 29 inch waist. does this make me less of a programmer even though i could whip RMS's ass any day of the week?

    3. Re:Evaluation: by Anonymous Coward · · Score: 4, Funny
      They should evaluate programmers by the length of thier beards. =)


      And when Ingrid Insightful finishes her day job, she heads off to her night job at the freak show as the bearded lady ;-)

    4. Re:Evaluation: by ackthpt · · Score: 5, Funny
      They should evaluate programmers by the length of thier beards. =)

      Other useful metrics:

      Spelling errors per line of documentation

      Size of chopstick collection

      Volume of spam on harddrive

      How many years out of fashion clothes are

      Months since last date

      Weight of programming manuals in personal collection

      Accumulation of fast food and junk food detritus on keyboard

      How long to gnaw leg off to escape meeting

      How many minutes can talk in jargon and acronyms alone

      Number of hours will voluntarily work if just left alone to do the damn thing

      Age of most out-of-date, yet essential, book and when it became out of date

      Serverity of unintelligible handwriting because everything is usually typed

      Increase in heartrate when new technical journal arrives

      Depth of paper, notes, cans, wrappers, computer bits, et al piled on desk

      Ability to quote from any Monty Python show, movie, recording, book, without error.

      Proportion in size of editor macros relative to actual code

      --

      A feeling of having made the same mistake before: Deja Foobar
    5. Re:Evaluation: by gazbo · · Score: 1
      even though i could whip RMS's ass any day of the week?
      Not literally - only ESR is allowed to do that.

      Metaphorically I'm sure you could. All it takes is a fat beardy to stand up, shout 'GNU/Freedom!' and suddenly everyone thinks that he's a great coder. RMS always makes sure *everyone* knows about the new app or modification he's written to make himself sound like such a l337 H4xX0r. Good coders don't need to do that; good coders are immediately recognisable as good coders, and this fact spreads by word of mouth. RMS is an idiot.
    6. Re:Evaluation: by bje2 · · Score: 1

      They should evaluate programmers by the length of thier beards.

      no...no...no...it's the length of their pony tails...

      --

      "Facts are meaningless. You could use facts to prove anything that's even remotely true." - Homer Simpson
    7. Re:Evaluation: by Anonymous Coward · · Score: 0

      You forgot

      Amount of slobber per day ;)

    8. Re:Evaluation: by Anonymous Coward · · Score: 1, Funny

      * Spelling errors per line of documentation

      This is a false metric. Real coders don't write documentation. Or comments.

      * Weight of programming manuals in personal collection

      Real coders don't need manuals.

      * How long to gnaw leg off to escape meeting

      They do not attend meetings. Occasionally, they are emailed the minutes. They never read them.

      * Proportion in size of editor macros relative to actual code

      Now you're talking. EMACS is clearly what makes RMS an Uber-hacker.

    9. Re:Evaluation: by joto · · Score: 2
      Actually, I can't remember one time that RMS has done that. What RMS seems to take pride in is the idea of the GPL, and the free software movement. I've never heard him need to point out to people that he in fact has written some useful software in his old days. And that is not his claim to fame either. RMS is the undisputed leading thinker and creator of the free software movement, and that is his "clame to fame", although I don't think he cares much for fame, only for his ideology.

      Besides, I don't think RMS does much programming these days. His schedule is so busy from travelling all around the world, that hardly anyone could blame him for that. (And when it comes to the matter of things: I generally don't judge people purely from their programming ability. (But if you do: then RMS should certainly be one of your heros. But so should many others, and there would be nothing special left about RMS.))

      The true idiots are the blind followers constantly praising him, and the raging lynch-mob constantly trying to take him out. Why can't people just be a little bit more calm and uninvolved, the matter of free software is a philosophical battle, and should be fought without needing to resort to ugly tactics.

      (and on the subject of kicking his ass: RMS doesn't look like a particulary strong or violent person, so I don't think he is going to kick you very hard, if he decides to kick you back...)

    10. Re:Evaluation: by Anonymous Coward · · Score: 1, Insightful

      Dude, that's completely rediculous. Some of the women I work with would make mad cash if they were evaluated by their beards, even though they're just stupid bitches.

    11. Re:Evaluation: by Anonymous Coward · · Score: 0

      Nice troll, gazbo. Only one bite so far - but it's a really good one.

    12. Re:Evaluation: by dasmegabyte · · Score: 2
      • Slashdot Karma


      If only...I'd have that raise in days!
      --
      Hey freaks: now you're ju
    13. Re:Evaluation: by Bubblesculpter · · Score: 1


      ...and...

      Hours spent reading Slashdot

      --
      www.Beyond7.com Insane modern art water sculpture.
  4. $ (is what matters) by mlknowle · · Score: 4, Insightful

    In a commercial setting, the awnser is obvious: how much money the software makes is how to measure the programmer's acheivment.

    In a different setting, it's not as clear......

    1. Re: $ (is what matters) by borgboy · · Score: 2, Insightful

      How much money does the data access layer of a web application make, compared to the user interface? How much does the overall design make, as opposed to the constructed code? IMHO, a useful metric has to take into account elegant, simple implementations, refactoring, reuse, test coverage, bug counts.....and the list goes on. Net sales aren't so much a factor as overall cost. Maybe $$$/function point?

      --
      meh.
    2. Re: $ (is what matters) by bjelkeman · · Score: 1

      "how much money the software makes is how to measure the programmer's acheivment"

      How much money software makes has very little to do with a programmers achivements. The sale and marketing budget completely swamps any programmers efforts on most commercial software projects. I have had very productive programmers work for me and not sold anything as the company ran out of money. It didn't sell anything and therefor the programmers were no productive? I don't think so.

      --
      Akvo.org - the open source for water and sanitation
    3. Re: $ (is what matters) by Winged+Cat · · Score: 1

      You can have the greatest code in the world, but no one to sell it (vis: any number of all-engineer, no-sales companies that have gone bankrupt). Does this mean the engineer did a sloppy job?

      Conversely, you can have barely working code, and have armies of marketers and salespeople (vis Microsoft). The engineer clearly was not as productive as the last example, but the results are higher $.

    4. Re: $ (is what matters) by TheConfusedOne · · Score: 3, Interesting

      You realize that by this measure Microsoft has the most productive coders in the world.

      Oh yeah, all those people who made/created Linux are completely unproductive.

      The big problem with any of these measures is you're measuring the wrong "product". Computer code isn't a product, it's a means to an end. Computer code is the final instantiation of an entire process from planning, to coding, to testing, to execution, to refining. First off, the version 1.0 of almost any program isn't the final product (fortunately). Second, wonderful, bug free code accessing the worst structured database is still a terrible application.

      So, the idea of evaluating productivity by looking at the code is just plain silly. Evaluate the project.

      --
      --- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
    5. Re: $ (is what matters) by LAI · · Score: 1

      $ is what matters...

      Well, great! My code has plenty of $'s in it! I guess I'm pretty good.

      This raises a few more questions, though: how much are @, % and & worth, and is * worth all of them put together, or their average...

      my brain hurts.

      --
      :eof
    6. Re: $ (is what matters) by Anonymous Coward · · Score: 0

      If your goal was to make a finished project that would never sell, then yes, your programmers were productive.

      If your programmers didn't finish the project in time to make money, then they weren't productive enough.

      If that's going to be your attitude, why not just sign up for wellfare and sit on your fat ass watching Ricki Lake and eating cheesypoofs?

    7. Re: $ (is what matters) by danboo · · Score: 1

      That's absurd. Do you really believe that marketing and design (along with many other steps in the process of creating commercial software) have no impact on overall profits?

    8. Re: $ (is what matters) by Anonymous Coward · · Score: 0

      How about scenarios like this, which I have seen happen:

      Marketing asks for a port to platform X. Programmers go off, develop, test, etc the product on platform X. Then, before we ship, marketing discovers that there isn't any demand for the product on platform X, and cancels the product. (or the product is released, and doesn't sell)

      Obviously, this isn't a good thing to do to stay in business, but it happens probably way too often. (and we still are in business, luckily) Were the programmers on the product productive? Suppose that they did a great job on the port, and finished it in record time, few bugs, etc...

    9. Re: $ (is what matters) by Zenithal · · Score: 1

      Unfortunately I have to disagree with this. Perhaps that's the way it should be, but I've found that it's seldom the case that a good batch of programmers produce money.

      That statement holds if you talk about marketers. The worst products in the world will make more money marketed correctly than the best marketed poorly.

      A company that starts with the letters 'Micro', and ends with the letters 'soft' comes to mind. :)

      --


      Aaron
      AaronCameron.net
    10. Re: $ (is what matters) by Anonymous Coward · · Score: 0

      Thank god. I've been crawling through the comments here just looking for one person to mention function points. Now I can quit and go back to picking my nose - a much more intellectually challenging occupation.

    11. Re: $ (is what matters) by Anonymous Coward · · Score: 0

      So now you have to politic and schmooze with the marketing and sales people to be a productive programmer? That's gross

    12. Re: $ (is what matters) by Anonymous Coward · · Score: 0

      In these days of recessive business politics, people are trying to find ways of benchmarking employee quality to see where staff cuts can be made. I think the article, viewed in this light, is using productivity as a euphamism for quality.

      The implication is that if people aren't judged simply by the number of lines of code they write, their 'productivity' and relative value to the company can be figured more accurately when it comes time to give staff the heave-ho.

      Alternately, the idea that programmer value can be determined by project profitability is not sound, either - even in the case where developers are driving a software product in lieu of marketing people. If developers drive the product, and the product fails, this is still a marketing failure. The question of programmers' value doesn't enter into it. The fact that programmers were driving the product is the failure of the company to recognize a disaster in the making, not the failure of programmers to be good marketers.

      What the article is actully trying to address is coding practices that distinguish a good programmer from a bad one, without regard to the marketing success of the project he or she is involved with.

      In this respect, I don't think it illuminated people on this point, as it missed out on mentioning the character qualities of programmers worth keeping. Technically, documentation and clear, concise code (etc.) are good measurements. But aesthetically, the attitude of the programmer towards his or her work is more important.

      If the person is a narcissist, or a bum, don't expect clear, concise, well-documented code. Good software writers are anything but this. They take ownership of projects, and are obsessed with polishing their own code.

      There is also a sense of mission about design - to create, maintain and improve programs to maximizing its potential for re-use. When code gets to this state, it represents the point at which someone's work becomes clearly 'valuable' - marked by its appeal and usefulness to other programmers who encorporate it into thier own designs.

      -AJCB

    13. Re: $ (is what matters) by borgboy · · Score: 1

      VIVA LA FUNCTION POINT. W00t!

      Sorry. It was the only thing i could think of to convey some sort of feature-oriented metric. They do rather suck. Hows the nose?

      --
      meh.
  5. well duh by I+Want+GNU! · · Score: 0, Troll

    It's obviously not about the number of lines of code. It's about the number of lines of code you can generate. With a simple while loop or for loop, you can generate infinite numbers of lines of code. Then, it becomes more about how fast you can generate the lines of code. Plus, you want to set a slight variation so that your employer doesn't notice, and thus you can get paid the most. Cause that's what coding really is about, isn't it?

  6. A better measurement is... by Jeremi · · Score: 5, Funny
    Problems solved (or tasks accomplished) per day. Whether you write 500, 5000, or -2000 lines of code to solve the problem is irrelevent, since the code is only a means to an end.


    As far as "what makes a programmer productive", I know what makes a programmer unproductive... reading Slashdot all day. Back to work, all of you! ;^)

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
    1. Re:A better measurement is... by Anonymous Coward · · Score: 0

      but different problems having varying degrees of difficulty and/or complexity. some bugs in code may be a simple 2-line fix, but others may call for a complete re-design of a module.

    2. Re:A better measurement is... by ivan256 · · Score: 2

      Would those be simple problems solved, or major engineering problems solved? Would the programmer who made a button change the values in a form to the correct ones have accomplished as much as someone who developed a more scalable network protocol, or increased the paralellism of a complex algorithim, or came up with a new mathematical theorm? Is the stupid manager going to decide that the button problem was harder to solve because the IDE generated 500 lines of code for his button click, while the computer scientist only generated a few pages of scribbling in his notebook?

    3. Re:A better measurement is... by blmatthews · · Score: 1

      I know what makes a programmer unproductive... reading Slashdot all day.

      I realize this was a joke, but unfortunately it's all too common of a sentiment among bad managers--anything but coding is bad.

      Keeping up with current developments in your industry and discussing those developements with colleagues is a good thing (if not taken to extremes) and should be encouraged. And even just taking a break to read some Windows bashing (:-)) can be refreshing and enhance long-term productivity.

      Brian

    4. Re:A better measurement is... by jmccay · · Score: 3, Insightful

      Using problems solved per day wouldn't be good. For one, some problems and projects can be spread over days, weeks, and months. This means that the number of problems solved will be less for someone working on a harder project than someone who works on simpler projects (and problems).

      Also, I would also have to disagree with the article. The following comment really isn't true: "[h]is code is shorter and simpler, and simplicity is almost always better in engineering". The larger code code be contained in well thought out objects, or functions, that make the reading of the main Objects, or functions, simpler to read, and the main bulk of the code if well engineered could also be reused easily.
      In his above example, Danny's code may not be anymore reusuable than Fred's. Danny's smaller number of lines per code could be result of not taking into account all necessary possibilities, or not thinking about possible future problems.
      The size of the code just doesn't matter. What does matter is how well the code is thought out and commented (both insertions and deletions of code). Well thought out code usually can produce some reusuable code and/or design patterns. Personally, as a rule of thumb, I don't like to write code more than three times for a given task or problem--unless I absolutely have to write it more times.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
    5. Re:A better measurement is... by Anonymous Coward · · Score: 0

      That would require a consistent size of problem/task.

      Consider the fairly large task "implement a garbage collecting memory allocator" and the medium task "add caching to the database query interface".

      Both tasks are of course underspecified becuase they need to be within the context of a project. The gc could also be better specified as "implement a conservative, mostly-copying, incremental, generational garbage collecting memory allocator" w/reference to G. May Yip's paper.

      But it's still difficult to split either into small tasks, especially ones comparable to something like "write functions to escape/de-escape URIs". (Ok, in the simplest case, adding caching to a database query interface might actually be the smallest task)

  7. Kind of like writing a paper by TrollMan+5000 · · Score: 1

    And less like a math exam.

    Instead of getting graded on how much you write, you get graded on quality. Is it clear, concise and to the point. Does it explain the points in your introduction?

    Over course this is an oversimplification, but it does take into account if quality over quantity.

    1. Re:Kind of like writing a paper by Daniel+Dvorkin · · Score: 2

      You're right. A program is not like a math exam. It is, however, a great deal like a math paper, much more than it is like an English paper. This is one reason why good computer science curriculums include a heavy math component, including upper-division courses where the emphasis is on expressing solutions to problems well, rather than just solving them. Perhaps the highest praise one mathematician can give another's work is to call it elegant; the same, I believe, applies to programming (which is really, still, a branch of mathematics.) Elegant code is the best measure of productivity -- and note that while elegance and conciseness often go together, they are not the same thing.

      --
      The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
    2. Re:Kind of like writing a paper by arkanes · · Score: 2

      what, you never got told to write a 10,000 word english paper(or a 10 page paper), and padded it by always spelling out contractions and numbers, wide margins, etc?

    3. Re:Kind of like writing a paper by Anonymous Coward · · Score: 0
      And less like a math exam.
      Well, I can tell that you're not a math major. One of the ways that you get marked down on homework and exams is when a proof is not elegant.

      Programming and Mathematics are similar in that you have to carve the bird at the joints. Brute force is bad in both.

    4. Re:Kind of like writing a paper by Daniel+Dvorkin · · Score: 2

      :)

      Actually, my problem has always been writing too much, not too little. When I'm writing something with a specified word count, I usually write what I'm going to write, realize it's ~20% too long, and end up going back and trimming it down.

      --
      The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
    5. Re:Kind of like writing a paper by Anonymous Coward · · Score: 0

      The thing is, in most organizations nobody ever reads code in that way.

      If you're code is really awful, your managers aren't going to figure that out; your peers who interface to it might. Or it might not be evident until after getting the project into testing when the bug reports start pouring in and all trace back to your code...

  8. Jeebus, talk about stating the obvious by Rogerborg · · Score: 4, Interesting

    Phew, what a long winded way to say: KLOC in any form is a useless metric.

    I was rather hoping for positive suggestions regarding better alternative, and especially some shiny references to back them up for when I take them to my boss.

    The best metric I've found is simply "Time until feature complete". Just that. Elapsed time between a feature being requested and it going live in the field with no bug reports coming back. Anything else is largely bunk. Trouble with that is that it's very hard for twitchy bosses to deal with the interim stages. "Time to code complete" is easier for them to monitor and deal with, but as anyone who has actually supported a product will know, that's only the beginning of a piece of software's life. Push the time to code complete back by a week, and you can save yourself month of grief later. ;-)

    --
    If you were blocking sigs, you wouldn't have to read this.
    1. Re:Jeebus, talk about stating the obvious by Anonymous Coward · · Score: 0
      Well, not really. That's one important measure. But it ignores things like how fast the code runs, how much memory it uses, how maintainable the software is, all important qualitative features in software.

      The fascinating thing is that all of those things are negatively correlated with lines of code. In fact, one can probably state that, in general, with two programs that are otherwise identical, the one with more source code is "worse".

    2. Re:Jeebus, talk about stating the obvious by PaulGibson · · Score: 1
      Time until feature complete. Hmmm, this sounds dubious. It may be quicker to sit down and code the feature, but then end up being very hard to maintain becuase the feature is not designed to interoperate well. How about time until feature complete, written in accordance with the established business rules and codebase? Actually, the whole idea of productive programmers begins with a solid design philosophy. I have found mostly that managers have no idea how to approach design and that developers would rather just get it done than struggle to define a bunch of hard things up front.

      I'm still going to give the summary to my boss, as it indeed is a usefull summary of a well known management principle, which has appeared in many publications and probably not first in Peoplesoft.

      sig me? sig you!

    3. Re:Jeebus, talk about stating the obvious by Rogerborg · · Score: 2
      • Time until feature complete. Hmmm, this sounds dubious. It may be quicker to sit down and code the feature, but then end up being very hard to maintain

      Here's an honest question: why did you even bother to respond to a post that you didn't read? I explained what I meant by "Time to feature complete", because it's not a common phrase. I won't repeat myself. Go back and brush up on your comprehension skills, and I only hope to god that you don't code the way you Slashpost, or if you do, that you don't work on anything mission critical.

      --
      If you were blocking sigs, you wouldn't have to read this.
    4. Re:Jeebus, talk about stating the obvious by markmoss · · Score: 2

      KLOC in any form is a useless metric. Duh!!! The problem is that the boss _has_ to have some metric, and so will seize on a bad one if no good one is available. And neither Charles' post, nor yours, offer anything useful. "Time until feature complete" is not useful per se, because features come in all different sizes. Figure out a way to score features by complexity, and you've got a starting point.

      Charles' post does have a "born yesterday" quality to it. Some smart people have been struggling with these issues for 50 years. There are various scoring systems, for instance function points. (Just search Google.) They are rather subjective, but if used honestly (not warping the scores to make your estimate fit a budget or time target), they are useful in estimating software cost...

      But now you have to take into account the laws of management behavior. Function points appear subjective, and take thinking to evaluate. Also, FP is a rather large measure (1 per man per week is about average), and because an FP is just part of a completed feature it's pretty hard to tell how many FP's were completed on the weekly reports. (And upper management MUST have those weekly reports to see if the project is still on schedule, and whether they are going to have to change all the marketing material from "XYZ 2002" to "XYZ 2003".) LOC might be meaningless, but everyone counts them the same, and if you're a micromanager you can count them every time someone checks in a piece of code and track "progress" on a daily, maybe even hourly, basis. That's if you believe that the project will actually require 800 KLOC exactly, and therefore when 600 KLOC have been checked in, you are 3/4 done. Never mind that the last 100KLOC are going to take longer than the first 700KLOC, and then the project still won't be done, those hard numbers were very comforting right up until the moment reality crashed in...

    5. Re:Jeebus, talk about stating the obvious by DrSpin · · Score: 1

      Maybe not save a bunch of grief, but at least you can extend your contract by another week!

    6. Re:Jeebus, talk about stating the obvious by PaulGibson · · Score: 1
      What the f**k are you talking about you fing neanderthal. You think that maintain means simply fixing bugs? Incredible: coders like you are still employed out there. You might as well work for Microsoft you idiot. My only point, you ignorant ass, is that design philosophy and communication of it to the developer team is more important than figuring metrics for evaluation of project status. Yes, I code so that there are no bugs, and that the code is maintainable. Perhaps you should look up the word maintenance while you have one thumb up your ass and the other in your mouth and before you switch.

      Obviously VB is your first and only language.

    7. Re:Jeebus, talk about stating the obvious by Fjord · · Score: 1

      To say it is a nicer fashion, maintainance also includes adding new features.

      --
      -no broken link
  9. Alas this doesn't cover much new ground.... by CresentCityRon · · Score: 3, Interesting

    This article was rather superficial and should have covered one point instead of several, giving the article a bit more depth. I got the feeling like it was written off the cuff this morning.

    (How do I know Danny does more work just because he does the same amount of work in less code. Its like the author follows some reverse logical mistake that he is harping about.)

    A very interesting book on this subject is "The Psychology of Computer Programming" by Weinberg. It will get you thinking! I think the "Mythical Man Month" also discusses related topics.

    Thanks

  10. Code Monkey by methangel · · Score: 0

    I work as a professional software developer and I can say that reusing our existing code to extend features, etc has helped us reach deadlines. Why reinvent the wheel?

    However, there is a breed of programmer that was not mentioned in the above article, I like to coin them the "Cut and Paste Coders." This breed of programmer likes to scour the net for code, and use them without giving credit to the program the code was lifted from. While immoral, could this be considered productive?

    1. Re:Code Monkey by Anonymous Coward · · Score: 0

      This is probably a top-notch coder.

      Guys who have to reinvent everything are usually smart people, but egotistical enough to think they code better than other people.

      They're worth having around just for the entertainment factor alone.

    2. Re:Code Monkey by Anonymous Coward · · Score: 0

      The worst coders are the "Copy & Paste Coders" who scoure an existing application/system for "useful" code, copy it elsewhere, and then tweak (hack/kludge) the copy to meet their needs. No refactoring. No new comments of value. No code inspection to verify the code they copied was, in fact, bug free.

  11. It depends a lot on Personality by epeus · · Score: 4, Informative

    Fortunately, you can tell a programmer's personality type by the code they write - it is all explained in this paper by Kevin Marks & Maf Vosburgh

    There are various types of programmers around. We've certainly worked with a wide selection. Over the years, we've come to realize that programmers can be divided into various "personality types". You don't stay the same personality-type your whole life though -- as you develop and learn, your approach to programming changes and that change is visible in your code. We're going to look at various functions and how programmers with different personalities would write them.

    MacHack attendees have normally been around the block a few times. That means they have learnt various things, like when you're going around the block, it helps to watch where you're going, and be driving a tank. We know that a function has important responsibilities. It needs to check every error code, keep track of every byte it allocates, and that function needs to know how to cope with anything that happens, cleaning up perfectly after itself and returning an error code which explains what went wrong. But in order to write code like this you have to have made mistakes and learned from them. We know we have...

    1. Re:It depends a lot on Personality by Anonymous Coward · · Score: 0

      That means they have learnt various things, like when you're going around the block, it helps to watch where you're going, and be driving a tank. We know that a function has important responsibilities. It needs to check every error code, keep track of every byte it allocates, and that function needs to know how to cope with anything that happens, cleaning up perfectly after itself and returning an error code which explains what went wrong. Unless you're using a good programming language which frees the programmer to concentrate on solving the problem rather than worrying about the minutiae.

    2. Re:It depends a lot on Personality by PD · · Score: 2

      Unless you're using a good programming language which frees the programmer to concentrate on solving the problem rather than worrying about the minutiae.

      And in a hundred years I hope we have one.

    3. Re:It depends a lot on Personality by DrSpin · · Score: 1
      Unfortunately, many of the lower levels of Windows drivers have no means to return error information to higher levels. Others are limited to simply returning the fact that there was an error, but without indicating whether it was fatal, and whether anything happened before the error or not.

      So if you want to write good quality code, you'd best not be writing windows device drivers!

    4. Re:It depends a lot on Personality by Anonymous Coward · · Score: 0
      And in a hundred years I hope we have one.

      No kidding. I believe the problem is not that you have to trade off certain things for others (although you do in some cases) it's that someone needs to learn to extract the good features of all known languages and combine it into a really good language. Accomplishing that feat will not be easy, so many have tried and failed, but I believe it is entirely possible.

      All I want is C with objects (or a module system at the minimum), type inferencing, array/memory bounds safety if I want it, pattern matching similar to Erlang, and regex operations as simple as Perl.

    5. Re:It depends a lot on Personality by Anonymous Coward · · Score: 0

      I've always wondered why someone didn't just make a better version of C. In hindsight we can see where the flaws are, why not make a new language based on C but that fixes all of the problems. It doesn't have to be source compatible.

      C++, Objective-C, and Java did not accomplish this. C++ and Java added too much and tried to do to much. C++ has the same problems as C plus introduced new problems while Java tried to do the VM/byte-code thing thereby requiring too much extra supporting runtime elements and performance is poor. Not to mention that it is impossible to directly access hardware in Java.

      Objective-C didn't do enough or just plain did it the wrong way. Type safety still sucks, dynamic binding is too slow, etc...

    6. Re:It depends a lot on Personality by egomaniac · · Score: 2

      These "personality types" are pretty specific to error handling in C / C++.

      As a die-hard Java programmer, it merely makes me shake my head in wonder at the kind of crap C programmers are willing to put up with. Certainly not to say that Java makes error handling irrelevant, or even necessarily easy, but at least I don't have to check if a pointer == NULL after every damned allocation. Optimists are a lot less dangerous in Java (still irritating, though).

      --
      ZFS: because love is never having to say fsck
    7. Re:It depends a lot on Personality by Fjord · · Score: 1

      Except that Java the language doesn't presribe how it is compiled. There exist native language compilers (and have for a long time. I used Assymetrix's SuperCede for Java in 97). Plus, Java has always had the native keyword, that allows you to link to C structured functions. And for the most part its impossible to access hardware directly in C, you typically either have to mix in a little asm to get you there, or call library functions that do the asm for you.

      And if you find dynamic binding too slow, then mark the methods as final (nonvirtual). I'm sure Objective-C has the same concept.

      --
      -no broken link
  12. Measure user happiness by jamesmrankinjr · · Score: 1

    Perhaps a more useful metrics are how many use cases a programmer has satisfied, or how many bugs were fixed. In other words, measure a programmer's productivity based on success in making customers/clients/users happy.

    Best,
    -jimbo

    1. Re:Measure user happiness by PhilMills · · Score: 2, Funny

      "No. of Bugs Fixed" is a great way to open the system up to some massive exploitation.
      IIRC, there was a Dilbert comic about this a few years ago: PHB decides to change the work metrics, and selects #OfBugsFound/Fixed. Wally, resourceful as ever, is seen a panel or two later saying "I'm gonna code myself up a new minivan this afternoon."

      PhilMills

      --
      Once you eliminate the impossible, whatever remains, no matter how improbable, will be quoted out of context on
    2. Re:Measure user happiness by ahde · · Score: 2

      that would mean forcing the business/marketing people to have a measureable quantity of work (meaningful use cases)

    3. Re:Measure user happiness by Anonymous Coward · · Score: 0

      The problem with counting the number of "problems solved" is defining a unit of measure for problem size/value.

      Function Point Analysis was one attempt, made a long time ago. It is ultimately deficient as are all the others I'm aware of to date.

      For extensive reading on the topic, you might try author searches for Barry Boehm or Capers Jones. Steve McConnell's books digest a lot of the earlier work by Boehm, Jones, Weinberg, etc...

  13. Sleep on it by certsoft · · Score: 1

    I come up with some good ideas while drifting in and out of sleep. Sometimes all it takes is a nap, fortunately I work at home and the bed is only a short walk away from the office. I also found that it helps to keep a small dictating recorder on the bedstand, that way you can record your thoughts in case you've forgotten them by morning.

    1. Re:Sleep on it by cat_jesus · · Score: 1

      I do this too. Only I use a pad and pencil. I've written some brilliant code that way. I've also written a lot of strange gibberish. YMMV.

    2. Re:Sleep on it by Anonymous Coward · · Score: 0

      I agree. I've solved a few problems away from work by sleeping on it or zoning out or whatever.

  14. Good Starting Point by 4of12 · · Score: 2

    I think the only other items I would add to this are pursuit of programmer metrics include

    • How enduring the code and design are
    • How extensible
    • How much other programmers like to extend the original code that a programmer wrote.

    It's hard to measure that, because the superficial situations are identical: programmers enthusiastically extending some well designed code on one hand, and a set of programmers grumbling about fixing things in a poorly written chunk of code.

    --
    "Provided by the management for your protection."
  15. How about.....? by radulovich · · Score: 1

    While I can appreciate the difficulty in measuring productivity and lines of code, the solution for productivity seems to be something along the lines of this:

    Productivity = (# of Programs written)/ (# of lines of code * hours worked)

    This formula, using a standardized program would show that the most useful programmer is someone who spends one hour on freshmeat to download the program that does exactly what you need. Despite writing ZERO code, this programmer is much more useful than anyone who writes code for even an hour because you won't have to maintain it!

    Standard measures use outputs/inputs. Always have, always will (think of cars per hour for Ford - outputs/inputs).

    Regards.
    -Mark

    1. Re:How about.....? by bpb213 · · Score: 1

      They might have to write zero code, but they then have to fuss about integrating code they havent written into their code, and looking through code that you didnt write yourself is a bitch :)

      --

      This .sig looking for creative and witty saying.
    2. Re:How about.....? by Derkec · · Score: 2
      In place of (# of Programs written) you need some sort of standard chuck size. It would be unfair to compare the "productivity" of someone who had to write tic-tac-toe to someone who had to write Microsoft Word all by themselves. There should be an attempt to break the programs into small tasks of approxiametly equal sizes. Also, I would put much more emphasis on hours worked, vs code spat out. Really small code is not always easier to maintain, no matter what it does for the programmer's ego. I'd put forward something like:

      (ChunksCompleted - ProblemChunksCreated) * QualityMetric / TimeSpent



      In other words, how much work you do minus the work your problems cause other people per amount of time spent is productivity. There is also some QualityMetric factor which should be between 0 and 1 to represent the maintainability of your code. This would include things like comments, code style, and proper compactness.


      This would address the case presented in the article since the Chunk(s) the creative developer were assigned got completed, likely with fewer problems created and with a high maintainability score. It also addresses the case where a developer "completes" one thing, but causes 5 days of work for other people. Instead of saying he's less productive (the 833 lines thing) it says he has negative productivity which may be more accurate.

    3. Re:How about.....? by Fulcrum+of+Evil · · Score: 1

      n place of (# of Programs written) you need some sort of standard chuck size.

      Okay, I'll bite. How large is a standard Chuck?

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    4. Re:How about.....? by sconeu · · Score: 2

      Isn't it about 3/8 inch for most drills?

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    5. Re:How about.....? by joto · · Score: 2

      I don't know, but I think it's obvious that it must be related to lines of code... (ducks before somebody throws something through the air)

    6. Re:How about.....? by Derkec · · Score: 2
      How large is a standard Chuck?


      That would be up the organization :) Seriously though, you get the developers in a room and break up what needs to be done into tasks that take roughly a half day or a day as you guess. That's a chunk. Basically you guess at how long something should take an average developer and use that as your benchmark. In cases where things went wrong, you'd need a way to split up chunks.

  16. Pointless metrics again by mccalli · · Score: 3, Insightful
    What makes a programmer highly productive?...I...propose a new definition

    One of the things that makes good programmer full stop is not worrying about trying to measure the imeasurable.

    Cheers,
    Ian

  17. how about goal-based measurements? by MassacrE · · Score: 1

    You won't have the same ruler for everyone, but at least you are counting work done rather than effort put forth. I don't care if someone writes 10k lines of code vs. someone writing 800 lines - if both pieces of code meet the requirements for the system, and are maintainable. I'd probably prefer the 800 lines of code anyways, since that would usually be _more_ maintainable.

  18. Old news by www.sorehands.com · · Score: 3, Insightful
    There was a piece a long time ago that compared the costs of hiring a Super programmer, and average programmer, and an incompetent programmer.


    It compared the lines of code and number of bugs to the salaries. Of course it said it was cheaper to hire a super programmer. But, it found that the only difference between the average programmer and the incompetent programmer was the number of bugs generated, not the lines of code.

    People need to be reminded of the high cost of debugging. It takes a long time to track down a bug.

  19. What makes a programmer highly productive . . . by Pike65 · · Score: 4, Funny

    ; )

    --
    "If being a geek means being passionate about something, then I pity those who aren't geeks." - Pike65
  20. BEST: Number of New Features per Day by mblase · · Score: 3, Insightful

    Your manager doesn't care how many lines of code you do or don't write. He doesn't care what those lines do, or how they work. That's because the client or customer doesn't care about those things. All they do care about is features: Did you add what we needed to add today? Did you finish ahead of schedule or behind it? Will we deliver on time or a week later?

    Optimize on your own time. All the non-developers care about is what gets into the final product, and if you meet the list of desired features, then you're productive. End of story.

    1. Re:BEST: Number of New Features per Day by emptybody · · Score: 1

      ok microsoft word programmer.
      add buckets of features.
      add buckets of bugs
      add buckets of code
      does that make a worthwile employee?

      make valuable features.
      please the most end users.
      resolve the noisiest issues.
      that makes a valuable employee.

      --
      comment directly in my journal
    2. Re:BEST: Number of New Features per Day by Anonymous Coward · · Score: 0
      Optimize on your own time.
      That depends on whether performance is important. If your boss is concerned with perfromance then you should optimize on his time.
  21. Near- total idiocy by PigleT · · Score: 2, Interesting

    Spot the bug in this thought, then:

    "Danny's code probably will be easier to extend and modify, and likely will have a longer lifespan, because of its compactness."

    This is potentially utter rot. If you make something "compact" then you're quite likely *using* the language to insert every idiom you can think of. That makes code *unreadable*, not productive at all.
    (Yes, I've been known to argue in favour of using prgramming languages' idioms before now, and more to the point I expect folks who dare to look at my code output to be able to read it, or else have the decency not to criticise it) but there are limits.

    The alternative is that he's implemented a sufficiently different top-level algorithm - and at that point you're not comparing like with like so you can't say one person is any more productive than another.
    However, you could introduce "amount of desired algorithm implemented per day" into the formula for productivity calculation.

    --
    ~Tim
    --
    .|` Clouds cross the black moonlight,
    Rushing on down to the circle of the turn
  22. You are correct by CresentCityRon · · Score: 1

    I forgot about Peopleware. Its a great book. The more I think about it the more useless this article was.

  23. who gives a stuff....... by chewy_fruit_loop · · Score: 1

    In the end I've found that project managers couldn't give a rats arse how many lines of code or how the hell you manage to do the work, as long as its in on time and hasn't caused any undue payments e.g. overtime etc.
    For all they care, you could have had a pit of slaves being tortured for a week, but the code is in and working.

    Mind you, if you bother to even try and explain how you did it or what the problem is, pm's usually start getting a very glazed over look in their eyes...

  24. Comment your gd code!! by MongooseCN · · Score: 5, Insightful

    I work on contracts for commercial software and it is amazing how much code people can write and not comment it. I had to change the functionality of some program once and it took me 5 days to write 3 lines of source. Why? Because I had to wade through code with variable names like "int32 data[7];". As a bonus there were hardcoded numbers to the variable. I had to do hex dumps at one point to see where the data was being used and how.

    As I shouldn't even have to say... commmenting your code improves productivity A LOT. Some people say you shouldn't comment code in a commercial product because then you can easily be replaced. My response to that is, why don't you do good work then you won't have to worry about being fired?

    If I had an employee who's not commenting his code, that means the next coder that tries to change something is going to spend a bunch of completely unproductive days just trying to figure out what's going on. I think I'd fire the employee because of his incompetence and the amount of time/money he going to make me waste.

    1. Re:Comment your gd code!! by Anonymous Coward · · Score: 0

      I had to do hex dumps at one point to see where the data was being used and how.

      Dude, get a debugger :-)

    2. Re:Comment your gd code!! by Mr+Windows · · Score: 1
      Comments in code are a good thing (especially if used properly), though not things like:

      i += 1 /* add one to i */

      Even better than source comments, though, are proper docs; design documents are a great help in changing or using others' code.

      WRT your comment about being fired, Gerald Weinberg said, in his classic "The Psychology of Computer Programming"; "If a programmer is indispensable, get rid of him [sic] as quickly as possible".

    3. Re:Comment your gd code!! by Rogerborg · · Score: 5, Insightful
      • it is amazing how much code people can write and not comment it

      Point taken, but I rather prefer writing self commenting code. What's better?

      • int32 data[7]; // Number of ISDN terminals per trunk. But then I should really comment every use of this monstrosity as well
      • int32 ISDN_Terminals_Per_Trunk[NUMBER_OF_TRUNKS]; // Why would you need to comment this?

      And anyone who complains that it takes too long to type "ISDN_Terminals_Per_Trunk" compared to "data" really needs to take a cluecheck about the relative amounts of time spend reading and writing code compared to comprehending and fixing it. ;-)

      --
      If you were blocking sigs, you wouldn't have to read this.
    4. Re:Comment your gd code!! by Coward,+Anonymous · · Score: 2, Funny

      And anyone who complains that it takes too long to type "ISDN_Terminals_Per_Trunk" compared to "data" really needs to take a cluecheck...

      In all fairness, ISDN_Terminals_Per_Trunk is a bit much to type out and can be shortened without any loss in understandability to ISDN_Terms_Per_Trunk and we can combine the last two terms giving us ISDN_Terms_Perunk and removing those pesky vowels gives us SDN_Trms_Prnk which can be condensed to DN_T_P and removing the ugly underscores gives us DNTP. But look at what your descriptive variable naming has given us, we now have a variable called DNTP which could easily be confused for some sort of Transport Protocol since it ends in TP. We could rename DNTP to something general like "data", we've kept the same first letter for easy recognition and it no longer looks like an acronym for a network protocol.

    5. Re:Comment your gd code!! by Boing · · Score: 1
      Some people say you shouldn't comment code in a commercial product because then you can easily be replaced. My response to that is, why don't you do good work then you won't have to worry about being fired?

      I agree with you that everybody should comment as well as they can and make it as easy as possible for someone else to understand their code. Ideally, their skill would make them irreplaceable to the company, and their good work would be rewarded.

      Unfortunately, as I think all too many people know these days, the people making the hiring decisions will frequently not have the same appreciation for your hard work as you do, and as other coders would. For people living in a practical world, it's easy to see how building in a little job security, even at the cost of product quality, could seem like a good idea.

      I hope for a day when the people who name complex variables "x" and embed important code into print statements will be punished for their treachery, and the added productivity will be used to reward programmers who actually work to improve quality. I don't think that day is coming anytime soon, however.

    6. Re:Comment your gd code!! by markmoss · · Score: 2

      Amen. We once had one of those "indispensable" progammers here. He went on vacation and never returned, just called back to say he'd found a better job. (And then the guy he talked to forgot to tell anyone else, but that's another story...) So a few months later, one constant used in just one place in a C program he wrote had to be changed. It took 2 days to find the spot in the dozens of .c and .h files, 3 seconds to change it, 1 day to figure out how to compile (he didn't archive the Make file, either), and an hour to test it.

      Proper design documents should have clued me in that I'd find this feature handled in this module, and cut that down to 2 or 3 hours all total. But there were no design docs, and the only comments were something like /* Author: Ash Ole, 1991 */

    7. Re:Comment your gd code!! by geekoid · · Score: 2

      in essence, I agree with you. however you say:
      "My response to that is, why don't you do good work then you won't have to worry about being fired?"

      thas nor realistic at all. As soonas a PHB see they can hir 3 overseas people for what your making, your gone. Nevemind the fact that they'll need to hire someone else later to fix the overseas code.

      What we need is specilized management training for program mangers.
      it should teach the following:
      1)There can only be one priority 1.
      I get a work priorty list, it may have seven item. % of them will be rated as my number 1 priority.

      2)you can not get a baby in a month by making 9 women pregnant. Please repeat until you UNDERSTAND that, not just repeats it.

      3)90% of the work take 10% of the time.

      4)we do not just type.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    8. Re:Comment your gd code!! by dasmegabyte · · Score: 2

      The other problem with not commenting your work is that you can never leave. And you will want to, eventually...no job is so good that it will always cover your every social, mental and fiscal need.

      We lost a developer to a non profit and have to make about 5 hours worth of contract calls to him per week. He has to take them, otherwise he'd get terrible references from us, and we have to make them because nobody can understand what it was he wrote.

      Great, thick, many lined code. Totally procedural, totally in-the-now. It is my job to go through it and automate a lot of the silly manual processes that seemed less silly in 1999, and it is daunting as these 4 and 5 hour calls that interrupt him from his real job result in increasing hostility.

      So yes, comments may save your job...they make also save you time in the long run.

      --
      Hey freaks: now you're ju
    9. Re:Comment your gd code!! by WotanKhan · · Score: 1

      I couldn't agree more. The problem with comments is that programmers (esp. contractors) rarely update them when making changes. So it is necessary to read the code anyway to be sure of the meaning of a code fragment.

      I believe that comments should only be used to explain particularly obscure techniques, or things that cannot be expressed with the code itself. Otherwise, they are distracting, increasing the difficulty of reading the code.

    10. Re:Comment your gd code!! by mikevans · · Score: 1

      anyone who complains about long variable names needs to spend some time learning how to copy and paste.

      --
      Some people have a way with words. Others not have way.
    11. Re:Comment your gd code!! by Fjord · · Score: 1

      And proper design docs are a myth. In most cases documentation becomes out of sync with the code, and leads to the same situation only extra time figuring out that the docs are lying. Good coding practices are a lot better and easier to maintain than supporting documentation.

      --
      -no broken link
    12. Re:Comment your gd code!! by LF11 · · Score: 1

      Do you use VIM?

      I used to comment code, then I learned about a cool little feature of Vim that allows for easy 'self-commenting' code; automatic completion.

      Say we have,
      ISDN_Terminals_Per_Trunk
      ISDN_Trunks
      ISDN _Controllers

      We type,
      ISDN Ctrl-P
      And get,
      ISDN_Terminals_Per_Trunk
      Type it again,
      ISDN_Trunks,
      Etcetera.

      Thus I have the lazy typing of variables such as 'd1' and 'ut', but with the readability of 'raw_data_from_file' and 'user_text'.

      Works amazingly well. Ctrl+p looks 'up' through the file, Ctrl-n looks 'down' through the file. You can also specify extra files and buffers to look it. This feature also makes standard coding a lot easier and *much* faster!

      (I'm sure Emacs can do this too, but the extent of my knowledge in Emacs is C-x C-s and C-x C-c. Sorry)

      -lf

  25. Programmers don't just code by anonymous_wombat · · Score: 1
    You also failed to list the many other things that software developers do, including clarifying requirements, mentoring other developers, design and code reviews, generating test code, etc, etc.

    Mechanical measurements do not really provide much value, just as trying to have everyone document all of their procedures ala ISO 9001 does not make good engineers replacable.

  26. No actual suggestions.... by BobGregg · · Score: 1

    >> I then propose a new definition that captures
    >> what programming is really about.

    Apparently, though, the author had no intention of capturing what the *original definition* (i.e. lines-of-code) was about, which was providing a way of *quantifying* productivity so it can actually be compared, aggregated, and used for real management purposes. Note that Timothy also summarized the article by calling it "a new way of evaluating the worth of programmer time". But the word "evaluate" implies assigning a *value* to that time. Without any way of quantifying that value, there's no evaluation going on anyway.

    This is a completely content-free article. For Pete's sake.

    1. Re:No actual suggestions.... by volsung · · Score: 2
      Ditto to this comment. The summary to this feature is very misleading. I thought this guy had actually come up with a usable metric, when in fact he just demonstrates in which cases lines of code (and other related metrics) is a silly way to measure performance. The programmer performance measure he closes with is ill-defined and not quantifiable. So, basically, he gives a happy, fuzzy idea that no one can actually use except in a Powerpoint slide.

      Editors: Please say no to features like this in the future! Use your head. It's probably better for this guy's ego anyway to have one of you tell him his article sucks rather than all of us. :)

    2. Re:No actual suggestions.... by Anonymous Coward · · Score: 0
      Apparently, though, the author had no intention of capturing what the *original definition* (i.e. lines-of-code) was about,
      I thought that he did an excellent job of capturing it.
      which was providing a way of *quantifying* productivity so it can actually be compared, aggregated, and used for real management purposes.
      No, which was a way of creating an illusion of management. The problem with KLOC is that it does *not* track productivity and progress. The author is crying "the Emperor has no clothes"m and will no doubt be ignored.
  27. What my company does... by NanoGator · · Score: 2

    I talked to my boss one day about how the engineers where I work are measured. Basically, it's along the lines of 'does the work get done?'. The project is defined with milestones set over a period of time, and if a deadline is missed the milestones are moved around a bit.

    We have engineers that may spend a day or two writing out a document to assist their coding the next day. That isn't considered a ding in their productivity. If anything, providing an insight into their code before they write it (psuedocode, not commenting) has been very helpful, particularly when the other engineers need to code parts that talk to each other.

    I honestly have no idea how this would scale to a >50 employee company. If it's really that important to make sure you're squeezing every ounce of productivity from your employee, I'd be concerned about where exactly that company is heading. Seems like investing more time into pre-planning would be more fruitful than lighting a fire under an employee to attain 'measurable goals'.

    In some ways, I'm glad I didn't choose programming. It's quite frustrating to predict when you'll have code you've never written before.

    --
    "Derp de derp."
  28. What a steaming pile... by jmagar.com · · Score: 0, Flamebait
    I must say that this is just plain silly. I have two comments, one about commenting code, and another about measuring productivity:
    1. "Well Commented Code" is code without comments!!! If you need to comment your code your have made it too complicated. All functions should be well described by the function name. If you can't describe what the function does by the name, then it should be more than one function. All variables should be self describing as well. In short if you have to add a comment about something that is strange/complicated/unusual then you should figure out a better way of doing it.
    2. Now as far as measuring productivity it should be measured by milestone dates and feature lists. If you have an agreed target date for a feature to be completed then hitting or missing that deadline is the only rela metric.

    That's all I have to say about that...
    1. Re:What a steaming pile... by Anonymous Coward · · Score: 0

      "If you need to comment your code your have made it too complicated. "

      Not only is this wrong, but I only wish I was your boss so I could fire your sorry ass.

      I've never seen code simple enough that it doesn't need a comment.

      For example:

      loop_counter++;

      Is too complex. I want a comment that explains when and why that loop counter is set. If there's no comment, I assume you're either a liar or a faker. And as I said before, I want to fire your sorry ass.

      Hope this clears things up a bit.

    2. Re:What a steaming pile... by RembrandtX · · Score: 2

      Commenting code is essential.

      if you think that anyone will be able to get what you were doing 2 years after you left/were replaced - your fooling yourself.

      within 2 years .. the whole scope of an existing project might have changed directions 2-3 times. What may seem an 'obvious' goal to you .. now .. working on the project .. Might be something that is not a goal later on.

      Yet your function is still there.

      If your code is clean .. yeah .. they can see what your *doing* , but that doesnt mean they know why your doing it.

      And I for one .. dont like naming my functions 'pullDataFromDatabaseAndSortItForRepeatsWhichWeSen dToAReport' a bit cludgey.

      Commenting your code has been around since the late 70's/early 80's .. when we stopped using punch cards (and even then people used to jot notes on cards) and I still think its a good practice if you want to write code that can be used/modified even five years after its inception.

      Not to mention that it might be nice to know where your incoming variables are coming from ..
      or what they are expected to do.

      $loop is pretty self defining ..
      so is $array

      but having a comment '// This function pulls an array of repeated fields, and outputs them to a report'

      took me only about 4 seconds to type. and saves someone the time of huting through other code to see what REFERENCES your funcion.

      *emote*gets off his horse*/emote*

      but granted .. we don't need a book every time either.

      --

      --Ne auderis delere orbem rigidum meum, non erravi pernicose!
    3. Re:What a steaming pile... by Anonymous Coward · · Score: 0

      I agree. No code should actually be commented. The first reason of course, is what you listed - if it needs comments, it's too complicated.

      The second is that if people think they can just glance at comments (or the code) and 'understand' it, then, they're full of shit and will end up causing endless amounts of errors when they try to modify it.

      People should be forced to actually read and understand code before they dare touch it.

    4. Re:What a steaming pile... by weylin · · Score: 1

      Comments that simply restate what the code does are, I agree, redundant but comments which explain WHY your code does what it does and assumptions you have made are invaluable during modification and debugging.

      Meeting target dates is not a good measure because it is so hard to estimate target dates in the first place.

      --
      --- Nukes don't kill people psychopathic megalomaniacs do.
    5. Re:What a steaming pile... by gdr · · Score: 1
      And I for one .. dont like naming my functions 'pullDataFromDatabaseAndSortItForRepeatsWhichWeSen dToAReport' a bit cludgey.
      Try having 3 different functions:
      • pullDataFromDatabase
      • sortForRepeats
      • sendToReport
      Chances are you might be able to reuse more code this way. If your function can't be described concisely it shouldn't be a function.

      Functions aren't just for spliting up long bits of code, they should represent logical units of processing.

      Writing self documenting code isn't about how you name your functions, it's about spliting your code up into functions (and classes etc) in a logical way.

    6. Re:What a steaming pile... by RembrandtX · · Score: 1

      of course .. i was only making a point ..
      but to be a devil's advocate ..
      if you are writing very modular stuff .. say .. bank reports .. in COBOL possibly

      you might have a function that changes when your vendor requires tweaks to their reports.

      so i might have a function PrintBankofAmerica();
      which calls a database, sorts etc , and generates a report ..
      of course .. i could just make a fuction of each called in the main function .. and replace as needed..

      works good in the classroom, not always in 30 year old systems *grin*. But yes .. that theory is the best way to do it if you can.

      People Bank's data may be pulled from an Oracle Database, and Bank of America off Reel to reel.

      and that may change on any given day dependong on the branch (shudder to think it .. but its true)

      My point was more that you can't depend on function names totally to describe complex functions.

      and one whole concept of a function in modular programming is to increase the abstration (like objects in C) so to replace the Bank of America reporting block ..i just replace that whole funcion (or the inclue/library or whatever it is this month)

      but yes , i agree , multiple functions that perform simple steps is the way to go if you have that luxury.

      --

      --Ne auderis delere orbem rigidum meum, non erravi pernicose!
    7. Re:What a steaming pile... by blibbleblobble · · Score: 1

      I often find it easier (in long functions) to write the comments first (copying the flowchart down onto pseudo-code, essentially), then check the comments (which makes it lots easier to spot errors) and then write the code after.

      That also makes it easy to see how far you've got with coding, because you can see how many comments you've expanded into code, and how many you have left.

      Then, you can take the comments-only pseudocode, strip out the comment-delimiters, and voila, you have the basis of a reasonably clear manual.

  29. Over-valueing comments by kevin42 · · Score: 5, Insightful

    Don't get me wrong, commenting your code is a must.

    However, I would rather have a programmer who writes easily understood code but doesn't document it well than one who writes well documented but overly complex code.

    I've worked on large projects where there was nearly a 1:1 ratio of comments to code, but the comment didn't help you see the big picture because the parts of the application were too far abstracted from reality. And the code was written in strange ways that made it hard for other people to understand.

    In summary, the code can and show be written so that most of it documents itself. If the application is well designed and the code is written well, the need for a lot of in-code commenting goes way down. This is assuming we're not talking about assembler, which in my opinion should have a nearly 1:1 ratio of code/comments.

    1. Re:Over-valueing comments by yintercept · · Score: 2

      The commenting issue is rather interesting. For some odd reason, I have very little problem reading computer code. I really don't care too much for the comments. When examing another person's work, I will often strip all the comments so I can see more of the code on the screen.

      Other people seem to like comments. It might be the case that this is a factor of how long you have been coding.

      I agree 100% with the assertion that the cost of long term support is part of the productivity of the coder, but, to an extent, the coder does not control the deciding factor in this cost, which is the personality of the person who does the support work.

    2. Re:Over-valueing comments by SLi · · Score: 1
      In summary, the code can and show be written so that most of it documents itself. If the application is well designed and the code is written well, the need for a lot of in-code commenting goes way down. This is assuming we're not talking about assembler, which in my opinion should have a nearly 1:1 ratio of code/comments.

      I don't agree at all about assembler being so much different from other languages. When you have a good command of the language, whether it's asm or some higher level one, well-written code is clean and self-commenting. That means carefully picked variable names and labels.

    3. Re:Over-valueing comments by bitrott · · Score: 1

      uh. yeah. you rule. *gag*. get over yourself.

    4. Re:Over-valueing comments by Rupert · · Score: 2

      The code can only tell you what the original programmer was trying to do. A good comment can tell you why.

      Most comments are not good, but neither is most code.

      --

      --
      E_NOSIG
    5. Re:Over-valueing comments by mikewas · · Score: 1

      I completely agree -- and then I've had a page full of comments to explain the single contorted, but necessary, line of code on that page. Complete with references!

      --

      "Glory is fleeting, but obscurity is forever." --Napoleon Bonaparte
    6. Re:Over-valueing comments by metacell · · Score: 0

      Documenting code is often seen as a "must", or even as a "waste of time". The assumption is that you document code for someone else, someone who is going to read it in the future.

      But I think documentation is much more important as a help to oneself in writing the program.
      The problem becomes much easier if you structure it, try to formulate it in words, draw diagrams of it, etc. It gives you a better overview and makes the problem clearer. And, I think the documentation becomes much better when you use it to help yourself, not because you have to or because "it's good practice to make a lot of comments".

      And doing the documentation before the actual program is not a bad idea at all. The clearer the specifications are, the easier it is to code -- and the simpler and more functional the code becomes.

  30. I've got to get my boss to read this... by Skweetis · · Score: 2, Funny
    Imagine Fred, Danny, and a third programmer, Ingrid Insightful, are given similar assignments. Fred and Danny head right to their desks and begin writing good code. Something about the assignment bothers Ingrid however, so she decides to go outside for a walk. After a lap around the park, she buys a decaf mochaccino, sips a little, and lies down under a tree. Soon she falls asleep.

    Now, if I can just get my boss to endorse this programming style...

  31. Deliverable LOC by Anonymous Coward · · Score: 0

    A good quantitative measure of a swe's productivity is DLOC. Deliverable demonstrates after all peer reviews, code reviews, test etc.. what survived, thus good or useful code.

    True, 2000 LOC / day is a worthless stat.
    if you say a SWE averaged 2000 DLOC / day, you better be treating that gal/guy right.

    1. Re:Deliverable LOC by Zurk · · Score: 1

      err...DLOC doesnt work either. which is what this article was trying to get across. did you even read it ?

  32. What about future re-use of the code? by Raphael · · Score: 3, Interesting

    This article seems to raise more questions than it attempts to answer... This is not surprising because the "programmer productivity" has been the subject of many debates.

    The proposed definition ("Ability to solve customer problems quickly") seems to ignore several of the good points mentioned earlier. For example, one can be able to solve a customer's problem quickly with an ugly hack. Some undocumented spaghetti code full of black magic may be able to solve one problem quickly, but it would be impossible for anyone to maintain this code later. Or to re-use it for solving someone else's problem.

    So who is more productive? The one who solved the problem quickly with an ugly hack or the one who solved the same problem by writing clean, documented and re-usable code?

    So it is a pity that what appears to be the conclusion of this article has thrown away the notion of clean and well-documented code mentioned earlier. Maybe a better (but more complex) definition would be: "Ability to solve customer problems quickly and to solve future, similar, problems in a quicker way". The drawback of this definition is that it cannot be measured on the current project, but only when the next one appears.

    --
    -Raphaël
  33. Yourdon covered all this shit in 1974 by owlmeat · · Score: 1

    Just read "Techniques of Program Structure and Design"

    --
    They stab it with their steely knives,

    But they just can't kill the beast.

    1. Re:Yourdon covered all this shit in 1974 by Anonymous Coward · · Score: 0

      And "The Mythical Man Month" by Fredrick Brooks

  34. Not just hypothetical by dbc · · Score: 4, Interesting
    Yes. I have personally worked with a highly productive (and higly respected) programmer who for months had high negative KLOC numbers because his job was replacing kludgy cruft with clean code that actually worked. It was a standing department joke.

    I want to add another angle... I managed validation. I viewed our job as reducing 1-800 support calls to zero. In the end, support costs need to be rolled into productivity numbers for develpers also. A couple of support calls from a single user can easily make the gross margin for the sale to that user negative. (And for you "free beer" programmers -- same thing applies, wouldn't you rather write code than spend time supporting users?)


    And a closing note: A wise manager once said: "Obviously you want smart, productive people on your project. Note that dumb, unproductive people are relatively harmless, because they are not productive enough to cause much damage. What you need to watch out for are dumb, productive people."

    1. Re:Not just hypothetical by kiick · · Score: 1

      Hey! What about the smart, unproductive people?

    2. Re:Not just hypothetical by dbc · · Score: 1

      Unfortunatly, they tend to be a distraction because of their entertaining and wide-ranging conversation. And of course, now with Slashdot they can be a world-wide distraction :-)

    3. Re:Not just hypothetical by nardoticus · · Score: 1

      Boy that was a wise manager. We had a dumb productive employee. He had a project, wrote thousands of lines of code, took one and a half years to write the code, had his code almost running for two years after that. We lost 3 major accounts and alot of credibility(good will). It took two smart productive engineers 6 months to completly redesign and rewrite and debug the product. We could say that DP employee was 1/3 as productive as the the 2 SP employees, since the SP employess took 1 man-year and the DP employee took 3+ man-years, but that would just be stupid.

  35. You forgot.. by UberFish · · Score: 0

    Betty Beentheredonethat.

    Shes the guy that wrote the code that Ingrid knew about and modified to a new task.

    So we have evidence that Betty writes documented, modifiable and extendable code that others can pick up and improve upon. She even appears to have created documentation that allowed Ingrid to know enough about the whole system to be able to identify the relevent program in the first place.

  36. i agree by cballowe · · Score: 2, Insightful

    I've always operated like Ingrid Insightful - I just can't convince managers to agree with me. If I could I'd make mid-day trips down to the Art Institute, or just go for a stroll while thinking about anything but the problem (strangely, the answers always come to me as soon as I get my mind far enough away from the problem that I can see the big picture clearly ... or maybe it's not so strange).

    Unfortunatly, I'm doing consulting work and there's something about the client prefering to pay for time on site. Suggestions for beating these concepts into management?

    1. Re:i agree by raresilk · · Score: 2
      This problem is not unique to coding, BTW.

      And I feel you have struck upon an important point - the mental process and work environment that best fosters creativity and insight does not fit in with the "work ethic" most business operations are comfortable with. Nor does it fit in with billing/pricing systems which are typically worked out to reward size, scope and complexity rather than elegance. So the Ingrid Insightfuls at any operation are often perversely penalized for the gifts they bring to the team. Or I should say, since I find it rare that anyone operates as Ingrid all the time, the person who comes up with the current creative/insightful but labor-saving solution is penalized. There is a certain inevitable resentment from team members who doggedly worked their butts off on the more traditional approach, and it always catches up with Ingrid in the end.

      --
      No, no, no. This is not a sig.
    2. Re:i agree by Anonymous Coward · · Score: 0

      I personally prefer a baseball bat for beating ideas into manegement. However I always assume one could use any manner of large, blunt, heavy object. :)

      - this post in no way suggests that beating managers w/ a bat is good....just effective ;)

  37. Engineering and reflection by BetaJim · · Score: 1
    Certainly LOC per time are not an absolute measure of programmer efficiency. Perhaps solutions per time would be a better measure.

    Even that may not gauge productivity well. Engineering a good solution takes time. On a software project that is unique you can't fast track your way to a finished product. While on some things I will sit down and start writting code; I realize that larger projects need to be designed first. Or at least need some up-front thought. Thats it folks: design and thought can give a good solution.

    --

    "Drug related crime" is a misnomer, "prohibition related crime" is the more accurate and correct phrase.

  38. Unask the question by MarkusQ · · Score: 5, Insightful
    There are many other ways of measuring programmer productivity. As a programmer and manager-of-programmers, I hold that they all have one feature in common: they are worse than useless.

    Having any defined metric is (IMHO) a Bad Thing in the long run, for the simple reason that people will sooner or later start gaming the metric. If you reward lines of code you get lots of lines of code. If you reward feature points you get lots of features. For a while I tried more abstract things like "user satisfaction," but that started drifting into the "The Customer Is Always Right" syndrom, with all the feature creep and bloat that goes with it. Using "my satisfaction as your manager" is even worse; brown-nosers are a danger to anyone undertaking a team effort with any element of risk.

    So I started wondering: do I realy need to measure productivity at all? Why do I care? The bottom line was, I don't care. I'm not interested in "producivity" any more than I am in "attendence." At this point, I tell people if you want to know what your score is, play a game, open an on line stock market account, or post messages on a web page that keeps track of karma. In this team, the focus is on getting the job done, not on keeping score.

    -- MarkusQ

    1. Re:Unask the question by Bazzargh · · Score: 2

      Metric as a measure of programmer productivity are crap, agreed. Metrics are not intriniscally bad however. One good use for metrics is to use them to identify 'hot spots' of potential trouble when doing QA reviews of code... saves you some time reading all of the code so that you can concentrate on the places which may well be badly wrong.

    2. Re:Unask the question by chrisbell · · Score: 0

      Can I come work for you? ;-)

      My "productivity" is currently being measured strictly by the number of hours I am in the office, rather than output (volume), quality (as nebulous as that can be) or other results. Yes, I do have the ability to work from my home office, but that does not count as productive time, so I don't do it any more.

      Too bad, too, as I tend to do very well when I can sit down in my nice, cozy office when I know what needs to be done (and how to do it), and can quickly accomplish my task. Their loss - I'm on salary.

    3. Re:Unask the question by DrSpin · · Score: 1
      If writing for real-time embedded, youu just might want to track "bytes of ROM used" and "Bytes of RAM used", so you know whether optimisation is worth spending time on, or whether you need to tell the hardware people that the price of memory is about to fall!

      I was on a project LAST YEAR for A MAJOR MULTINATIONAL (In deep financial doodoo) who had me, and another very experienced programmer, spend two weeks hacking a bunch of stuff so they could use smaller flash chips, only to find that the small chips were obsolete, and the production systems would have to have the large ones in anyway!

      We did warn them, but the decisions were taken at a very high level :-}

    4. Re:Unask the question by estes_grover · · Score: 1
      There are many other ways of measuring programmer productivity. As a programmer and manager-of-programmers, I hold that they all have one feature in common: they are worse than useless.

      huh? 'They all' being the metrics? Or the programmers?

    5. Re:Unask the question by markmoss · · Score: 2
      they are worse than useless.

      huh? 'They all' being the metrics? Or the programmers?


      If you don't know which programmers are producing, eventually most of those remaining WILL be useless. And in the present litigious environment, when it's time to fire the deadwood, it does help if you have numbers rather than a subjective evaluation -- even though if you are clueful, your subjective evaluation is probably more accurate than any metric...
    6. Re:Unask the question by Mithal · · Score: 1
      I think the whole issue comes from management style. Some people try to manage programmers as they do chain manufacturing employees: just count the number of units done in a day.

      Do they evaluate doctors, engineers, or managers performance using simple metrics? Usually not, because they see them as trying to solve problems. They recognize that a quick correct diagnosic of a cancer is better than requiring tens of tests (and days)!

      There is a not-so-new concept in management called empowerment: giving responsibility to employees, so that they regulate themselves. Any manager that still needs a simple metric to evaluate employee performance just didn't get it.

    7. Re:Unask the question by xski · · Score: 1

      In this team, the focus is on getting the job done, not on keeping score.

      Got any openings for C/C++/Java developers? ;)

    8. Re:Unask the question by Anonymous Coward · · Score: 0
      Having any defined metric is (IMHO) a Bad Thing in the long run, for the simple reason that people will sooner or later start gaming the metric. If you reward lines of code you get lots of lines of code.
      You realize that you've divulged classified information to unauthoprized personnel, don't you?
    9. Re:Unask the question by MarkusQ · · Score: 3, Insightful
      Metric as a measure of programmer productivity are crap, agreed. Metrics are not intriniscally bad however. One good use for metrics is to use them to identify 'hot spots' of potential trouble when doing QA reviews of code... saves you some time reading all of the code so that you can concentrate on the places which may well be badly wrong.

      Agreed. There are all sorts of nifty tricks you can do with objective things like code, mud, starlight, or prime numbers, because you can make statements about them that can be disproved by testing. If you say "most of the time is being spent here" and someone else says "no, the problem is that this routine is recomputing the value of 12 each time" it is posible to test and see who is right.

      My objection is to trying to use "objective" metrics on subjects like programers that know you are measuring them and thus can change their behaviour to get "good" scores without actually doing what you want. In general it isn't possible to easily disprove statements in such systems (it would probably make the legal system much simpler if you could) and I object to metrics that pretend you can.

      -- MarkusQ

    10. Re:Unask the question by MarkusQ · · Score: 1
      Got any openings for C/C++/Java developers? ;)

      Sorry, not at the moment. My two most active projects are in Ruby and Lisp, and neither of them needs anyone at the moment. But thanks for asking.

      -- MarkusQ

    11. Re:Unask the question by mozmozmoz · · Score: 1

      Actually, they do measure doctors by magic numbers, and often managers too. Which is one of the problems... About the only peoplo who don't get measured by magic numbers seem to be the accountants, who get performance bonuses anyway.

    12. Re:Unask the question by MarkusQ · · Score: 1

      Can I come work for you? ;-)

      Sorry, no. I'm not hiring at the moment--a year and a half ago or so I was in the awful state of being both desperate and picky, but the last year or so there have been a lot of good people available. It's tempting to over extend, but I made that mistake once a few decades back and don't care to repeat it.

      My "productivity" is currently being measured strictly by the number of hours I am in the office, rather than output (volume), quality (as nebulous as that can be) or other results. Yes, I do have the ability to work from my home office, but that does not count as productive time, so I don't do it any more.

      Gack, that bites. I'll bet your "office" has little mid-numbing gray head-high partitions made out of pressed wood and carpet too. When I was last serving time in a minimum securi^h^h^h^h programing in a "cube farm" I managed to stay productive with headphones and pride in my work (internalized), but I hear it has gotten worse. I'm impressed that anyone manages to be productive in corporate America these days. All I can offer is "hang in there"--or, I suppose, bail out. In any case, best wishes.

      -- MarkusQ

  39. Ancient issue has been addressed before by GMontag · · Score: 4, Informative

    Ummm, this appears to be a regurgitation of a segment from Triumph of the Nerds . With the Microsoft guys saying that productivity should be based on getting a problem solved vs. the IBM guys saying that productivity should be based on LOC or KLOC (thousands of lines of code) or MLOC (millions) etc.

    Being a "Data Miner" myself, I can certainly agree with the problem-solving-as-productivity approach, rather than the "how many inner joins can I throw at this to make it look like I am busy" approach.

    Actually, the LOC as productivity is so foreign to MY thought process that I can not comprehend why anybody in management or in direct labor would bother to think about it.

    1. Re:Ancient issue has been addressed before by _J_ · · Score: 1

      My experience with IBM has been that they use function point counting to determine the size of a project. that was part of their RAC process. Oddly enough it was created in 1977 by an IBM'er. More info can be found here.

      As for using KLOC's; any easily quantifiable measurement will be pounced upon if it has the slightest relationship to accomplishing goals. A finite number of lines of code are needed to complete a software project, therefore the PHB conclusion is that the number of lines of code is a measurement of the project itself.

      IMHO, as per

      J:)

  40. It's about the design .... by Anonymous Coward · · Score: 0

    I have always viewed good design and high maintainability as good programming. But I can see other standards applying as well depending of the type of application being written.

  41. A dated approach by Glock27 · · Score: 3, Interesting
    Given today's environments, with a ton of already available classes and components an important measure of productivity is how well these things are reused. "KLOC per day", in any form, is a very poor metric for this.

    A metric that takes real productivity into account for new projects (the Ingrid example above wasn't a great one since she was maintaining code, not creating it) would be one that measures requirements met versus time. It would of course be up to the manager to say whether the time taken was too long, about right, or less than expected.

    A developer that consistently meets requirements with working code, in a timely manner, is a good developer.

    Clearly the key to success with this metric is managing your manager's expectations. ;-)

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
    1. Re:A dated approach by sconeu · · Score: 2

      Given today's environments, with a ton of already available classes and components an important measure of productivity is how well these things are reused. "KLOC per day", in any form, is a very poor metric for this.

      A proper COCOMO model takes reuse into account for project size estimations.

      Incidentally, having spent years in a company that used a COCOMO cost estimation model, the reason for counting LOC is this: It's not to measure your current progress. Any manager who does it is a PHB and an idiot.

      But... A good manager uses those numbers to tune the COCOMO model, and to be able to judge the size of any *NEW* project you might be bidding/proposing. For that, LOC is actually a reasonable metric.

      It's so that you can go to a potential customer, and say, "Yeah, we can do that. It'll take X calendar months, and Y man-months, so it will cost you Z dollars. Our cost estimates use a COCOMO 2.0 model, tuned over the past 10 years, so no, we aren't BS-ing you."

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    2. Re:A dated approach by Glock27 · · Score: 2
      For that, LOC is actually a reasonable metric.

      Really? How do function points and "Lines Of Code" relate, exactly?

      Who is the more productive programmer - the one who implements an entire new grid control for his data (taking eight weeks to finish), or the one that uses an existing grid control (taking one week to finish). The first one might win using a "KLOC/day" kind of metric...

      Or did I misunderstand your point?

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    3. Re:A dated approach by Anonymous+Brave+Guy · · Score: 2
      Given today's environments, with a ton of already available classes and components an important measure of productivity is how well these things are reused.

      Sorry, gotta disagree there. Reuse is not an objective in and of itself, and the amount of reuse you get out of your existing code is utterly irrelevant, except in as much as it affects other useful metrics. If you have code that's beautifully reusable, but I can rewrite the same features from scratch each time faster, then other things being equal I am more productive than you. Overgeneralising code in the pursuit of a phantom "reuse" goal is a major problem with the industry today. That's not to say it isn't often a good thing, it's just to say that it isn't necessarily a good thing.

      A developer that consistently meets requirements with working code, in a timely manner, is a good developer.

      But only if his code is also sufficiently readable and maintainable that others can work on it later as well, for example.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    4. Re:A dated approach by aminorex · · Score: 2

      >If you have code that's beautifully
      >reusable, but I can rewrite the same features from
      >scratch each time faster, then other things being
      >equal I am more productive than you.

      But other things aren't equal. Now there is twice
      as much code to maintain, duplicated business logic
      that has to be kept synchronized, etc.

      >Overgeneralising code in the pursuit of a phantom
      >"reuse" goal is a major problem...

      Agreed. We call it overengineering. No
      abstraction should be created that does not
      contribute directly to fulfilling a requirement.
      This is where the XP mindset shines: Never do
      anything you don't have to do yet. Future "needs"
      rarely materialize in the anticipated form.

      --
      -I like my women like I like my tea: green-
    5. Re:A dated approach by sconeu · · Score: 2

      I think you misunderstood my point.

      You're not measuring "productivity". You're measuring "Size of the Job", so that you can come up with reasonable cost estimates for future jobs.

      Function points are just as reasonable as SLOCs for estimation. It all depends on what model you use.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    6. Re:A dated approach by Anonymous+Brave+Guy · · Score: 2
      But other things aren't equal. Now there is twice as much code to maintain, duplicated business logic that has to be kept synchronized, etc.

      But again, those are assumptions on your part. I've seen plenty of code where an overengineered solution has produced one large (but only in one place) mess instead of two small and non-overlapping solutions to simple problems, and the monolithic solution has clearly needed many times as much code as simple, individual solutions. The project I'm currently blessed with working on is a prime example; the original development team thought, a few years ago, that they could anticipate future needs, and created a massively powerful framework capable of doing just about everything short of flying us to the moon. Unfortunately, writing the equivalent of "Hello, world!" now requires more code than it does with MFC...

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  42. Dijkstra on LOC by devphil · · Score: 5, Insightful
    Whether you write 500, 5000, or -2000 lines of code to solve the problem is irrelevent, since the code is only a means to an end.

    Agreed. I think it was Dijkstra who argued that if Lines Of Code are counted, then the number should be viewed as a liability rather than an asset. That is, LOC are not something we produce, but something we spend.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:Dijkstra on LOC by Anonymous Coward · · Score: 0

      So in other words, this:

      if (a==b) { stuff(); c+=morestuff(); toomuchstuff(); }

      is better than this:

      if (a==b)
      {
      stuff();
      c+=morestuff();
      toomuchstuff();
      }

      LOC is not something that can easily be counted either way.

    2. Re:Dijkstra on LOC by hgh · · Score: 1

      >> That is, LOC are not something we produce, but something we spend.

      I don't see how that makes a difference. Managers are just going to ask "well, how much more are we going to have to spend."

      hgh

    3. Re:Dijkstra on LOC by refactored · · Score: 2
      Hence Carter's Compass...

      I know I'm on the right track when by deleting code I'm adding functionality.

      It is my favourite thing to hammer the business folk with, LOC's are liabilities, not assets. They freak out totally when it finally penetrates...

      Sort of like watching a caterpillar go into a "which foot first" fit.

    4. Re:Dijkstra on LOC by Tony-A · · Score: 2

      The concept should not be that unfamiliar. Ever read something where the author took lots of words to say very little?

    5. Re:Dijkstra on LOC by Tony-A · · Score: 2

      A sentence written out this way
      is
      better
      than
      one
      written
      this
      way.

    6. Re:Dijkstra on LOC by refactored · · Score: 1
      Ever read something where the author took lots of words to say very little?

      Robert Jordan Wheel of Time series comes painfully to mind....

      Except code is much worse. I will probably only read the Wheel of Time once, at worst twice. I reread the code I'm maintaining many times.

    7. Re:Dijkstra on LOC by GregWebb · · Score: 1

      (Trolling with +1? Or just odd...)

      Depends what you're doing, Tony.

      With an example that trivial it's a matter of personal preference. I prefer the space of writing it out across the lines, I know some (such as yourself) prefer it all in one line. Still can't understand why :-)

      Let's say we have three branches, though, and each branch contains, ooh, 10 statements, and they're not common between the branches. Not really worth splitting into three procedures, but gets nasty if we put that all in one line.

      Hence my preference for splitting it: once anything gets large it's definitely better, when it's small it's about 50-50.

      --

      Greg

      (Inside a nuclear plant)
      Aaaarrrggh! Run! The canary has mutated!

  43. Lines of Code? Wrong, wrong, and wrong again by juliao · · Score: 2
    It's not about lines of code.

    It never was. Or maybe it was, back then.

    Old-school lines of code were assembly instructions, or COBOL statements (which map fairly easily to assembler anyway).

    But all this has changed, a lot.
    Software these days is about components, about reuse, about APIs. Reinventing printf gets you more lines of code, but is useless and stupid (in most cases).

    Object orientation throws productivity into a whole new ball game. You should get productivity points for reusing code, not for rewriting. So it's never, hasn't been for some time, about lines of code.

    Even function points are better.

    But anyway, is productivity such an issue for programmers?

    Productivity is a business concern, and makes sense in a business environment. And businesses don't (shouldn't) build software by throwing programmers at it.

    Businesses build software through a process that involves requirements, analysis, then design, test suites, and then coding and testing and documenting.

    What part of all this does programming involve? 15%?

    Forget lines of code. Forget kindergarden productivity measures, forget subjective analysis into what is "good code" and "documented code". You document BEFORE you code. And it is "good code" if it implements what is documented.

    Anything else is just fooling around.

  44. IBM Meeting by Anonymous Coward · · Score: 1, Insightful

    I work for IBM as a software engineer and one time in a meeting a mid-level manager actually uttered the phrase:

    "Its been shown that code reviews increase quality by 94%".

    I knew then that these people don't have a clue what programmers do. They want to quantify something that is qualitative. You just can't fight someone who lives in a contradiction.

    Apoptosis

  45. I picture the enconomy recovering... by afniv · · Score: 1

    from programers napping under a tree and sipping a decaf mochaccino. Be careful, the parks are going to be full....

    I'm not a programmer, but if I was caught "thinking" about a problem like that, I wouldn't last very long. At least in my line of work, engineering, you can't just think of an elegant solution, you have to tackle the problem and make results.

    The example scenario could have just as easily been Ingrid remains under the tree thinking, and Fred and Danny finish the job for the customer to start on another project.

    --
    ~afniv
    "Man könnte froh sein, wenn die Luft so rein wäre wie das Bier"
    Richard von Weizs
  46. Time and Money by stoolpigeon · · Score: 2, Interesting

    It is really all about time and money. Both have already been posted seperately but these 2 measurements are the clincher.

    Sometimes really good code is just not worth it.

    Sometimes code is not worth it period. (There are better ways to solve the problem than a custom process)

    If you don't make enough money to pay for the time- you won't be in business long. (At least as long as your software engineers are willing to live off their own credit cards and pick up company expenses.)

    .

    --
    It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
  47. I'm not impressed by Zen+Mastuh · · Score: 3, Interesting

    While I admire the author's brave attempt to establish a new model, I must conclude that he has failed: Applying a quantitative measurement to a qualitative phenomenon is absurd. Do we judge a painter by the number of brushstrokes and conclude that Rothko is lazy and Van Gogh is a diligent worker?

    There are many qualitative components by which a programmer can potentially be judged: sheer output, ability to debug others' code, ability to have code debugged by others, ability to create understandable extra-code documentation, affinity for the lifestyle of the person doing the judging (i.e., likes to go out for a beer after work, roots for the same professional sports team, etc...), concentration skills, hygeine, and so on. Attaching metrics to this is nothing short of masturbating one's ego. There is a wonderful allegory to this in Robert Anton Wilson's Schrödinger's Cat trilogy, in which a self-important researcher attempts to rate a woman's orgasm using measurements on scales developed by the doctor himself.

    --
    "What is the sound of one belly slapping?"
  48. Metrics Are Useless if They Are Not Easy To Use by mmonagha · · Score: 1

    The point of developing a metric is to condense information in an easily digestible manner. Ideally, the metric should be easy to measure and not subject to manipulation. Although I admire your definition of productivity, it is essentially useless since it is based on qualitative instead of quantative data.

    Productivity is a manufacturing concept that is inherently difficult to apply to the software creation process. At its base, it is usually defined as outputs produced/inputs required. This works very well for a manufacturing plant making gizmo X but does not work well for writing software.

    The truth is that the only way to tell who is a good programmer versus a bad programmer is to have the years of experience in the industry to tell the difference.

  49. Fred Fastfinger by wiredog · · Score: 2
    Imagine his code ... contains no comments at all ... The next programmer to take over Fred's code will find it impenetrable

    Amen, brother. I was the poor bastard who was the "next programmer". Fixing "Fred's" poorly written and worse documented code did do wonders for my skills, however.

    1. Re:Fred Fastfinger by okpunk · · Score: 1

      Word.

      Similar experience here. And it did wonders to boost my confidence as a programmer, to feel the zen of "Jebus, that's ugly!" and know exactly why.

  50. The real question by ahde · · Score: 3, Insightful

    isn't who was more productive, Fred or Danny, in the situation above, but who was more productive if Fred wrote his 5000 lines in 5 days and got it done, and Danny wrote his 2500 lines, took him 10 days to get it done.

    That's the dilemma facing project managers-- is it better to "get it working now" or "ease extensibility/maintenance later." There is no hard and fast solution. It's different for every project, and often misjudged, in part because you can't see into the future to determine its lifespan. Of course everyone wants two Dannys who get done in 5 days, but that's not the real world scenario.

  51. Productivity by soap.xml · · Score: 2, Insightful

    Measuing the productivity of a software "designer/engineer/coder" or whatever you want to call them, is a very difficult thing to do. On our current project we are using a third party tool that is riddled with bugs, unfortuantly due to management desicions we are unable to ditch the product and search for a different tool. However, my team has remained highly productive during this past month while working with the vendor to solve the issues.

    Have we produced many lines of code? Not really, probably around 9000 lines between the 6 of us over the past month, that is about 1500 lines per programmer... in over a month. According to any logic using "lines per day" or anything along those lines, we are in horrible shape. However, we have been solving many of the issues with the vendor, scouring over lines of code to ensure that the tools are working correctly, changing and tweaking our testing classes (Java) to ensure that everything is truly working the way that it is supposed to be.

    Now, with about a month of time wasted according to typical programmer productivity analysis, we have a decent library of functionality built up (or easily migrated into a library), we are very familiar with the product that we are using and the APIs, and will probably come in on, or before schedule.

    Was that time wasted? Were we unproductive? I would say no to both of those questions. Yes working with a vendor with broken software was frusterating and time consuming, however we now have an intamite knowledge of a third-party "black box" and we have, in the process of working with them, built up a suite of test cases that will help us immensily in the near-term future.

    But, we only turned out 1500 lines per programmer in a month you say. However do to all of the debugging work, and API "scouring" we have done, we will probably be able to turn out closer to 500-1500 lines of good well documented and working code every day or so.

    Well my point is simply this: Lines of code per day is simply not a good analysis. The best way to determin productivity is on a per project basis. How is the project coming? Are the objectives being met, are you solving the problems that are coming up in a timely fasion? There is no final answer, it must be evaluated per-project, per-team, per-company.

    -ryan
  52. missed one by LaMuk · · Score: 1

    I worked with a programmer for years who used to complain that his program had grown so large it wouldn't fit into his editor anymore. What he was really doing was bragging about the lines of code he had written.

    Then one year I had to look at his code to convert it from COBOL to SQLWindows. O my God! Whenever he could have easily written 6 lines to process an array, he had cut and paste the first line the number of iterations that he wanted and then changed the index number.

    The funny thing was that in our shop nobody cared how many lines of code were written as long as it worked. He was an old COBOL programmer that had come from work places where they actually counted the lines.

  53. simplicity is almost always better in engineering by iguild · · Score: 1

    I don't agree with that. It often is "better" (to use this expression) to not use regular expressions for example but a self-written routine that does the same task. The code might not be that small but it might be much faster. I (and the system running the software) would prefer this over the simplicity.

  54. The End of Work by Anonymous Coward · · Score: 0

    This story reminds me of a book we read in a university philosophy class entitled "The End of Work". It was about how despite the fact that the industrial revolution (and later the information revolution) was supposed to largely eliminate human labor, most people still find they spend most of their time working. The book suggested that a reduced work week would lead to greater productivity much the same way Ingrid was more productive. The main question posed in the book was this: if we are supposed to be benefiting from all these labor saving technologies, we aren't we working less? It also touched on related topics such as unemployment and wealth disparity. The problem with Ingrid in the above example is that she is the most likely candidate to get fired. Like it states above, there is no good direct way to measure productivity. That reality directly conflicts with a company's need to measure productivity. It sounds like Connell endorses the same idea proposed in "The End of Work". Unfortunately there is no quick, conrete solution to the problem. The answer sought in "The End of Work" is through legislation and tax incentives. The last criterion set forth by Connell is too abstract to use on any short term basis. It's simply just a messy and very abstract problem.

  55. Former employees by inerte · · Score: 1

    Be careful when you have to fire someone. I guess you will have to give a reason, and if you touch the subject of "You lack XYZ", your current employees when talking with the former will know your reasons.

    1. Re:Former employees by MarkusQ · · Score: 2
      Be careful when you have to fire someone. I guess you will have to give a reason, and if you touch the subject of "You lack XYZ", your current employees when talking with the former will know your reasons.

      There are a couple of things you can do to minimize this problem:

      Be very careful who you hire, to reduce the risk that you will ever need to fire them. Make sure your team has frank, open communication between all members. Don't "raise mushrooms," no matter what. Have a "no surprises" policy and stick to it; if someone isn't working out, make sure they know, and know why. Ninety nine times out of a hundred they will either get their act together or decide that they'd be happier doing something else, somewhere else. You can help them in either case. One time out of a hundred they'll be stupid about it (e.g. "If you let that $%#@#!@ touch my code again I'll burn this place to the ground" or "I don't care if you're all writing lisp, I'm writing VB. So there") and you'll have no trouble documenting cause.
      If you aren't careless (and aren't in France) it shouldn't be a problem.

      -- MarkusQ

    2. Re:Former employees by Chep · · Score: 1

      Well, in France, you can fire people too, especially since "most"(s/most/all/) contracts specify that the employee must abide by the employer's or the manager's commands and rules (and not complying with "write software in Lisp" or "there is no code ownership, you must accept that Fred modifies this or that module to make it work" is indeed a way to get shown the door. It may take receiving this kind of orders in writing, but once you got them in writing you know you're fired if you stray from them. And you get zero severance pay in that case)

  56. He's just illustrating the point! by Anonymous Coward · · Score: 1, Insightful
    Your "revelation" is old news

    Charles Connell is playing the part of Danny Designer, writing an article which restates ideas that have been stated before. You, on the other hand, are playing the part of Ingrid, finding the old information and simply re-using it. I'm sure this is what Chris was hoping you would do, in a nifty reality-hack kinda way...

    Um, yeah.

  57. No shit? by Anonymous Coward · · Score: 0

    Almost every page when reading Presman's Software Engineering book, I felt disgusted and a "that's too fucking absurd, why can't anyone see it". The only things which actually made sense were Fred Brooks' quotes.

    You can't measure stuff like that. How do you measure love, for example? My neighbour loves his wife 1.39, whereas I only 1.2. In fact, we had an argument last night. Oh come on.

    Writing software becomes rigid and well-defined only after there is 100x the budgetted expenditure available, and 1000x the time needed to spend in the project. If you don't have those, then you better let robots write your well-defined software for you.

    Doh!

  58. this is not a difficult problem by Anonymous Coward · · Score: 0

    Give the programmer a job to do.
    Does he do it fast? does the stuff work well?

    hes productive.

  59. So incisive.... by ZanshinWedge · · Score: 2

    Wow, it's so wonderful to see such incisive an understanding of programmer productivity. Who knew that lines of code is a bad measurement of productivity? This changes everything!

    Oh...wait a minute...this would be old news if it were posted on slashdot circa 1975, it's positively fossilized now. Sheesh.

  60. Ack! by ackthpt · · Score: 1
    As far as "what makes a programmer productive", I know what makes a programmer unproductive... reading Slashdot all day. Back to work, all of you! ;^)

    Argh! Caught in the act! Guess I'd better get back to writing errors in code! ;-)

    --

    A feeling of having made the same mistake before: Deja Foobar
    1. Re:Ack! by Maditude · · Score: 2, Funny

      Hehe, anyone else remember the old Dilbert cartoon where the PHB decides that bonuses will be awarded for each bug fixed? Wally tells Dilbert: "I'm going to write me a minivan this afternoon".

    2. Re:Ack! by ackthpt · · Score: 1
      Yes. There's also one where Dilbert and a salesman are discussing who pays for bug fixes and Dilber realizes the more bugs the vendor includes, the more his employer has to pay in support fees. The salesman mocks him and tells someone on his phone they're going to be rich.

      I took umbrage, about 17 years ago with a vendor, for not including something in release, which was a routine fundamental to a few applications. When they told me they would fix it in the next release, due in 6 months, I yelled something to the effect of 'what the hell are we paying you people for if you don't send out the missing code on a tape right away.' The boss announced I was to write the missing code myself and not talk to them anymore. Sometimes you get to see just how bad it is and get no support.

      System Development Life Cycle
      -------- -------

      Wild enthusiasm for new project

      Implementation

      Failure and disillusionment

      Search for the guilty

      Punishment of the innocent

      Promotion of non-participants

      --

      A feeling of having made the same mistake before: Deja Foobar
    3. Re:Ack! by hgh · · Score: 1
      Hehe, anyone else remember the old Dilbert cartoon where the PHB decides that bonuses will be awarded for each bug fixed? Wally tells Dilbert: "I'm going to write me a minivan this afternoon".

      Then, Dilbert has Ratbert dance on the keyboard to create more bugs. The result: a web browser. hahaha...

      hgh
  61. If only all managers could understand... by 192939495969798999 · · Score: 2

    ...this article, life (for me) would be a better thing. Thanks for noticing that the best way to solve a problem is not always to sit down and start coding until you have coded a solution.
    I have seen a lot of good programmers code for hours, but I have also seen truly gifted programmers walk around and "process in the background", then go back and present a solution just as valid but with much less "machine time".
    Sir_Haxalot

    --
    stuff |
  62. This post is not a troll. by Rahga · · Score: 0, Troll

    However, this article is a troll. It's soooo hardocre, even the Gap Troll envious.

  63. And the implications of taxing development -- art? by teambpsi · · Score: 2

    What stuns me is that there is evidently a plan in some municipalities want to tax software development efforts as if it were a manufacturing business.

    For me software is a consultative and artistic endeavor.

    I don't know how "science" ever made it into the moniker -- when they tax architects perhaps it would be categorically fair.

    --

    Old age and treachery almost always overcome youth and skill.
  64. Quantifying the qualitative... by sterno · · Score: 3, Insightful

    This is yet another case of trying to quantify something that is qualitiative. It's is pointless to try to measure somebody's quality as a programmer (or as anything else for that matter) by using some numerical assessment. The examples above demonstrate that clearly, but here's a couple more examples:

    Which is more valuable, a programmer who churns out 1000 lines of code/day but very reclusive or the one that does 500 but is also good at communicating project directions with others?

    Which is more valuable, an inexperienced programmer who learns quickly or an experienced programmer who doesn't?

    if you want to know how good a programmer is to ask them the right questions. I'm not sure exactly what those questions are, it depends on what you want out of them. But I've been on many interviews and it's amazed me the vast differences in interview quality. People who are trying to measure the quality of a programmer by "lines of code" are setting themselves for lots of problems.

    I think I was asked once to estimate lines of code I've written and I had NO idea. Frankly if somebody did know the answer to that question I'd be concerned. It sounds like somebody who's too busy keep track of the metrics that imply their skill rather than actually doing good work. These are likely the same people who are staring at the clock for the last 15 minutes of the day, constantly estimating the minimum amount they need to do to get by.

    --
    This sig has been temporarily disconnected or is no longer in service
  65. Lines of code by rtaylor · · Score: 2, Funny

    If someone demanded more lines of code from me I'd write a perl script which would take all my loops and unroll them, then the function calls inline.

    Never again would they want more lines of code.

    --
    Rod Taylor
    1. Re:Lines of code by oogoody · · Score: 1

      >Never again would they want more lines of code.

      Oh yes they would. In fact, they would ask
      why you can't keep up that level of
      productivity.

  66. Deleting Code by Neil+Blender · · Score: 2, Interesting

    Sometimes I feel most productive after I have deleted thousands of lines of code. Code that has been replaced by better code. A good day is when CVSweb reports +500 lines -3000 lines.

  67. Quantity vs. Quality by ArthurDent · · Score: 2

    The ratio of code to comment is not important. It's not quantity, it's quality. The comment needs to say anything that is not obvious from the code that needs to be said for the reader, who knows nothing about the code, to understand what is going on.

    Another important feature of comments is a changelog-ish sort of function whereby each software change is documented within the code. Where I work, all of us in Sustaining Engineering write in a bug number with each change that we make so we can go back and find why that change was made later on when we look at the code and wonder why the heck we did that.

    These are a few good rules of thumb in my experience at least..

    Ben

    1. Re:Quantity vs. Quality by kevin42 · · Score: 2

      It seems to me after a while you will end up with a huge amount of comments in your code. Isn't that what revision control is for? If you use CVS and you want to see why something was changed, you can do an annotate to see when it was changed and who changed it, then read their comments.

      I can see where you would do what when supporting 'finished' product, but for a project under development or in a beta stage, I think you would end up with way to many bug #'s to make the code readable.

      BTW, I agree with what you say about quality vs. quantity.

      The article made reference to someone who coded bug-free code but didn't document it, and how that meant he probably wasn't productive. It is that statement I think is wrong. I'm much more interested in how he coded it than how he documented it.

    2. Re:Quantity vs. Quality by ArthurDent · · Score: 1

      If you end up unreadable because of too many bug numbers then the original code wasn't very good was it? :-)

      You could accomplish the same thing with version control, but you can't see the version control information when you're looking at the code can you? That's the advantage to also putting in a comment.

      Ben

    3. Re:Quantity vs. Quality by Bazzargh · · Score: 2

      Have you read Martin Fowler's Refactoring: Improving the Design of Existing Code?

      Theres a view that comments are actually a sign of *bad* coding, because:
      * a comment before a method may indicate that the method is poorly named, not well focussed, or has too many arguments & options
      * a comment within a method may indicate that a method is overly long and there is a smaller method crying to be factored out.
      * comments are often used to help describe overly complex tricks in software. The solution is not to comment but to simplify the code.
      * sometimes comments are just there because QA tools insist on them (when the method name told you everything that would be in the comment)
      * boilerplate comments with change logs really should be managed by your SCM tool (I have to agree with one of the other replies here!)

      Like every rule it doesnt apply in every case. However it is worth thinking about. It isnt an excuse to go strip out all your comments - all I'm saying is that the _need_ for a comment is often an indication that the _code_is_bad_. Martin's book has some good examples demonstrating refactoring code to remove comments.

      -Baz

    4. Re:Quantity vs. Quality by RandomInAction · · Score: 1

      comments are often used to help describe overly complex tricks in software. The solution is not to comment but to simplify the code.
      Iv'e often found examples where this is true, where the previous guy has taken an 'egotistical' approach to a problem. With the result that very few lines of code produce the result, but the solution demand commenting which was usualy lacking. Often actually writing some additional lines can be a better approach if it makes the code readable. IE self documenting.

  68. problem with metrics by Anonymous Coward · · Score: 1, Interesting
    All in All metrics start out as a useful tool, but degenerates into mindless idiotic expectations. Professional developers know what programming is about, but managers may not. Therefore business people strive to come up with some form of metrics to cover their ass. For better or worse, it's a necessary evil. But what tends to happen from personal experience is said PHB treats the metric as a iron clad equation.

    Having a quick and easy equation isn't inherently bad, until it gets into the hands of a lazy manager. I would argue good managers don't need or use stupid equations to figure which member of his team is productive or not. Bad managers on the otherhand don't care enough to really understand the project, the engineers or the problem to set realistic expectations. Having an equation gives the bad manager a false sense of control and often results in the wrong person getting credit. I don't have any solutions. Ultimately, I don't think there is one solution or even a best solution. Software development is an organic process, so the more specific an equation is, the more likely it won't work in practice. If all programmers were equally trained, there wouldn't be a need for productivity metrics.

    Unfortunately that doesn't exist. Having programmers of varying experience and skill is part of the challenge and makes programming more challenging. Sometimes generalizing API is necessary to make it easier for other programmers. Sometimes generalizing is over engineering. No one can predict the future, therefore the concept of productivity is temporary and arbitrary.

    Placing value on n lines of code is always a sketchy excercise. At best, it's harmless.

  69. Can't measure... by sporty · · Score: 3, Informative

    *sigh* Code quality is subjective. Perfect example:

    if( 1 == x )

    Runs fine, looks butt ugly, but works. Is this of quality? As long as it works? As long as its easily readable?

    What about a function that does:
    int x ( int a, int b ) { return a/b; }
    Runs fast. Can break.

    Its all subjective baby. You can't measure it by speed of coding, by lines of code, number of functions, number of bugs..etc... Its a matter of the employeer of the programmer being happy with his output.

    Next questin :)

    --

    -
    ping -f 255.255.255.255 # if only

    1. Re:Can't measure... by sporty · · Score: 1, Flamebait

      Oh, btw.. yes, I said "his" code. If you are a chick programmer.. you should either...

      a. Not exist. You are a myth.
      b. Be a supermodel and be married to me.

      ;)

      --

      -
      ping -f 255.255.255.255 # if only

    2. Re:Can't measure... by raung · · Score: 2, Insightful

      This is off topic:

      I don't understand why "if( 1==x )" is ugly. If the poster prefers "if( x==1 )", then I submit that some (experienced) programmers use the former because they know how easy it is to mistype the comparison operator. In that case, "1=x" causes a compiler error while "x=1" simply assigns 1 to x and continues.

    3. Re:Can't measure... by Anonymous Coward · · Score: 0

      If you had used a real language that wouldn't have been a problem.

    4. Re:Can't measure... by sporty · · Score: 2

      Well, people are used to left handed comparison. Its probably more cultural than anything else.

      You usually get a warning if you do if(x=1) vs if(x==1), but you are right, 1=x is going to generate a compile err vs a "probably warning".

      Then again, a good compiler /might/ optimize for..

      x=1;
      if(x)....

      -s

      --

      -
      ping -f 255.255.255.255 # if only

    5. Re:Can't measure... by thehossman · · Score: 1
      You are correct, code quality is subjective. High Quality code should not only be functional, and error-free, but it should encourage (by example) future code which is equally functional and error-free.

      As raung points out: in some languages there are compelling reasons to put constants on the left, to prevent possibly un-noticed uses of if (x=1) ... the fact that a situation like that CAN happen in SOME languages, is reason enough why people should put constants on the left when they write code in ANY langauge. It gets you in the habit of doing it, so you don't have to actively remember: "I'm writting C code today, so I should put the constant on the left ot be safe." Other people reading your code are reminded by your example that it's a good idea, and they learn from your code practice.

      As stupid as i think your example of "poor quality code" is, your point is valid: It's not enough to say "i wrote this many lines of code" or "i wrote this many lines of error free code" .. you also have to ask how easy that code will be to debug, and how easy it will be for other people to read it, understand it, and (most importantly) learn from it.

      --
      -- The Hoss Man
    6. Re:Can't measure... by Fjord · · Score: 1

      This reminds me of how people would hate it when I would do something like the following in my Java code:

      if ("Y".equals(string))

      I would do this because sometimes string could be null and I didn't want a NullPointerException to be thrown, I wanted it to evaluate to false.

      Of course, it is better to have "Y" as a static final variable, but even that would bother some people and that wasn't their objection.

      --
      -no broken link
  70. Pascal quote by PhilHibbs · · Score: 5, Insightful

    "I have made this letter longer than usual, because I lack the time to make it short."
    -- Blaise Pascal

    If anyone deserved to have a programming language named after him, it was the originator of this quote. I just wish it had been a more concise and expressive language.

  71. What works for me. by Anonymous Coward · · Score: 0

    If five hours worth of study leads to five minutes worth of coding that solves the problem, it is a productive use of my time.
    However, if five minutes of research leads to five hours of coding, no matter whether it solves the problem, it's a poor use of my time.

  72. Zen and the Art of Code Maintenance by Coward+Anonymous · · Score: 2, Funny

    You're trying to define quality - quality of code. Just be certain you don't go insane trying.

    1. Re:Zen and the Art of Code Maintenance by sconeu · · Score: 2

      You're trying to define quality - quality of code. Just be certain you don't go insane trying.

      I think Justice Potter Stewart's comment re pr0n and obscenity is relevant here: "I know it when I see it."

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  73. Ease of Use by bpb213 · · Score: 1

    One thing to keep in mind when rating programer productivity is Ease of Use & Understanding.
    If i can write a function in 100 lines and make it self explanitory, it would be worth the time to do so, so that a year from now a programmer can come in and modify it to relfect the changes in the corporate software.
    This is a much better approach then trying to write the same function in 20 lines of code, but making it so cryptic it takes a trip to langley to decode. (and dont mention anything about "job security", because in a year you wont understand it either.... :) )

    Another method of good coding is reusability.
    if i can reuse some code, then by all means do so. otherwise make methods you write reusable so that others can improve their productivity.

    --

    This .sig looking for creative and witty saying.
  74. this is where communication counts by twocents · · Score: 1

    If one as a developer cannot show progress in a matter that can be understood by manager types, then it seems to me that managers often then lean heavily on trivial numbers, such as lines of code or made up completion dates, just so they can put it all into a report. So I think how a developer communicates to the outside world (if they are in that position) makes a huge difference on how their achievement is rated.

  75. for example... by Anonymous Coward · · Score: 0


    if you measure the quality of a slashdot post by the number of lines of text/post then this article was pretty good!

    Really though, this is a great example of another problem with many folks in the software industry: gripes/solutions

    This reply inclusive.

  76. The Mythical Man-Month by Animats · · Score: 5, Informative

    This guy clearly hasn't read The Mythical Man-Month. He should.

  77. What is counted as code. by slam+smith · · Score: 1

    I'm starting to work with EJB's, and I'm finding that a lot of the "code" has been put into xml files. So do I count the stuff in the xml files a code. Some of these files can get enormous and I think are often more difficult to get right than the actual code.

    Also he left out another important resource that I use. I'll go out on the internet and books and download sample code that mostly does what I want. And just modify it. What level does that get me to?

  78. metrics =money by mekkab · · Score: 2

    having no metrics is a BAD Thing in the long run.
    Why?

    You need metrics to prove to clients that you can perform based upon YOUR schedule estimates, not thiers. (and we all know their estimates are "we want it done yesterday!")

    Example:
    You have a client who likes your work, but is interested in cutting down costs as much as possible. You say "I think it'll take 19 months to get this done". They say, "well, we were hoping for 12. Change your estimate."

    How can you quantify your company's performance? How can you prove to the client that it will really take 19 months and that reducing it to 12 will do nothing but ensure that the project misses the schedule? By having metrics to back up your performance.

    Using metrics to judge your employees is wrong, shameful, reserves you a special spot in hell, and will get you shot in my neighborhood. However, not being able to show the customer your track record in terms of performance is as good as giving the contract to your competitors.

    --
    In the future, I would want to not be isolated from my friends in the Space Station.
    1. Re:metrics =money by Fulcrum+of+Evil · · Score: 1

      You need metrics to prove to clients that you can perform based upon YOUR schedule estimates, not thiers.

      what's wrong with basing your credibility on a track record of accurate estimates for similar projects?

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
  79. shorter ain't always better by Darth_Burrito · · Score: 2, Funny

    Fred now writes comments and he completes his program by writing 1000 lines of well-documented, correct code per day for five days. Danny also completes his assignment in five days, but he writes only 500 lines of code per day

    Unfortunately, Danny's code was written in perl and looked like this:
    s''$/=\2048;while(){G=29;R=142;if((@a=unqT="C*",_) [20]&48){D=89;_=unqb24,qT,@ b=map{ord qB8,unqb8,qT,_^$a[--D]}@INC;s/...$/1$&/;Q=unqV,qb2 5,_;H=73;O=$b[4]>8^(P=(E=255)&(Q>>12^Q&gt ;>4^Q/8^Q))>8^(E&(F=(S=O>>14&7^O) ^S*8^S>=8 )+=P+(~F&E))for@a[128..$#a]}print+qT,@a}';s/[D-HO- U_]/\$$&/g;s/q/pack+/g;eval

    1. Re:shorter ain't always better by Tazzy531 · · Score: 2

      I think the keyword here is "well-documented"

      --


      _______________________________
      "I'm not Conceited...I'm just a realist..."
  80. Factor 50 by Anonymous Coward · · Score: 0

    I am one of those programmers-wannabes who got the chance in the it-heydays. I was surprised to see the difference between the good and the bad. In my experience a veteran can easily be fifty times as productive as a wannabe (read me...).

    Ok, so I was a bad programmer. Today I am project leader, where I do better.

  81. He Missed the Point about LOC by dbretton · · Score: 3, Insightful

    The writer is truly missing the point regarding the purpose of measuring performance regarding lines of code.
    Source Lines of Code (LOC or SLOC) are used, by management, to get an understanding of the overall productivity of software engineers in general. It is not an end-all,be-all rule regarding software engineering.
    If you take a sampling of 100 good programmers, given clear requirements, and measure their performance, you will be able to determine the overall productivity for a single engineer on a per day/week/month/year basis. This allows managers to make some determinations regarding project planning, enhancements, changes, and yes, to some degree, the performance of engineers.

    For example, if I know that my engineering group of X people are capable of contributing 1000 LOC per person per month (per man-month) to a project, then I can better estimate the cost and schedule of a new project. The project's scope is determined by detailing the customer's desires, and developing a break-down of capability. (Things such as R&D, training, and new technologies are identified and have an appropriate risk factor associated with then).
    A LOC estimate is associated with each capability, which consequently will produce a timeline and cost.

    What the author should have really reflected upon was not how to refine the software productivity metric, but rather how to refine the application of that metric.

  82. I didn't think that by crivens · · Score: 1

    I never thought that productivity was measured in lines of code. To me, it's progress against a schedule.

  83. netscape.net by QuantumG · · Score: 2

    and you're talking about code size. hmm.. glass house.

    --
    How we know is more important than what we know.
  84. I have! by barzok · · Score: 5, Insightful

    About 2 years ago, I was working on my first major project and the project manager called me one day out of nowhere to ask where my progress was (normally we covered this in a weekly meeting). I started giving him percentage estimates based on feature completeness, structure completeness, etc.

    So then he asks "how many lines of code do you have?" I tell him that I don't use that as a gauge, I use what I just told him for my progress. Also told him that I don't count lines. He persisted, so I came up with a rough count. He says "so if you say you're at 60%, and have X lines of code written, then you'll have Y lines when you're done, right?"

    I had to reiterate (for the third time in that phone call) that LOC means nothing - it may very well be that I only had 100 lines left to put together, but it would tie up the remaining functionality needed (by gluing all my pieces together).

    But he just kept coming back and harping on that LOC number, no matter how I tried to persuade him that it was meaningless. He was convinced that this was how he would know how much work went into the project. I guess the 3 weeks of writing very little code and charting out the logic of the app didn't mean much to him. He was taken aback when I told him "I don't just start writing code on day 1, I plan things out"

    1. Re:I have! by Skidge · · Score: 5, Funny

      This is why you tell managers numbers that will make them comfortable with your progress, no matter if they are really accurate. The better your managers feel about your work on the project, the better you will feel, since they will stop bothering you as much. In other words, arbitrary and meaningless questions deserve arbitrary and meaningless answers.

      Of course, you still need to finish everything on time or your arbitrary and meaningless answers won't work the next time. :)

    2. Re:I have! by seanadams.com · · Score: 1

      But he just kept coming back and harping on that LOC number, no matter how I tried to persuade him that it was meaningless.

      Reminds me of a Dilbert strip (paraphasing):

      PHB: I read the program you've been working on. Your punctuation needs work - you use too many colons.

      Dilbert: I like them, sir. They remind me of you.

    3. Re:I have! by DigiitalWiz · · Score: 2, Informative


      The company doesn't base on the LOC of code.
      This is how it works. But alittle background first. The company I work for creates billing/customer care software for cell phone comp's. The applications we have aren't out of the box. Each site is totally different.

      Anyways. First the customer requests a change or new feature, a impact assessment(IA) is created with what's going to be changed and if any possible problems with current functionallity.
      Once the Customer has reviewed the specs, they write off the IA and then it's my turn. I then review the IA, I then rewite a detail design doc laying out what objects I'm going to change(btw the application I work on is done in POwerbuilder) size of labels/colors/.... Once thats done, then I write out Unit test cases in TestDirector(http://www-svca.mercuryinteractive.co m/products/testdirector/) based on the IA. Basicly this is based on the Detail design, so it's that i verify that the new label I added is in fact BOLD and in RED. Just make sure I haven't gotten anything. THEN it's off to writing the Application Test Cases, once the application is compiled and how it should work, of course to verify that everything the client wants is there.

      AFTER thats all done, then I code. So 3 weeks that was given to me for this project, 50-60 is writing out documentation(no that I enjoy that crap.) then it's off coding, which has been done already while creating the Detail Design. Then it's off testing Unit and Application test cases.

      97% of the time there are no bugs sent to the client and 99% what they asked for was added and working.

    4. Re:I have! by Anonymous Coward · · Score: 0

      Dilbert : No sir, "C" isn't the grade for my project, its a programing language
      PHB : What if you used "B"?

    5. Re:I have! by Mike1024 · · Score: 5, Insightful

      Hey,

      The project manager called me one day out of nowhere to ask where my progress was... I started giving him percentage estimates based on feature completeness, structure completeness, etc.

      So then he asks "how many lines of code do you have?"


      You should of told him that just today you Enhanced Shareholder Value by rearranging your equations, converting this:

      Foo := sqrt((1/3)*(x+5))

      to this:

      Foo := X + 5
      Foo := 0.333333 * Foo
      Foo := sqrt(Foo)

      This lead to a threefold increase in lines of code, whilst making the program clearer and easier to maintain.

      Tomorrow, you should say, I plan to modify all our string-processing code to work only in the flexible and intuitive EBCDIC instead of the ASCII which we already have libraries for. Liberal use of copy and paste could lead to a 65% increase in lines of code.

      Michael

      --
      "Goodness me, how unlike the FBI to abuse the trust of the American public." -- The Onion
    6. Re:I have! by oni · · Score: 2

      had to reiterate (for the third time in that phone call) that LOC means nothing

      Might I suggest that you get him a copy of The Mythical Man-Month

    7. Re:I have! by barzok · · Score: 2

      Fortunately, he's no longer with the company. At the time, I hadn't yet read TMM-M.

    8. Re:I have! by Anonymous Coward · · Score: 0

      LOC means nothing. NOTHING. It may take one programmer 100 lines of code to do something that may take another programmer 50 lines of code. I just finished re-writing a function that was so redundant it wasn't funny. It is now less code and more readable. So should I get burned for writing 50 lines instead of 100?? Metrics need to be based on functionality not lines of code.

    9. Re:I have! by keithdowsett · · Score: 1

      Best of all - when you re-work some components the number of lines of code may go down. Does this mean that the project is going backwards??

      Keith.

  85. Yet.. by ackthpt · · Score: 1
    Yet, some people write comments as bad or worse than they code. We had a Sr. (by title only, AFAIC) programmer where I once worked, he spelled the same variable three different ways in a moderately complex statistical application. Stupidly, the bug, failing to assign or read the right variable probably worked out within an acceptable margin of error. Before the programmer left for another job, he was required to go through thousands of lines of code and document, what had been documentation free code. I was handed the project, took about 3 days looking through it and decided it was less work to understand what the application did, what the inputs and outputs were and just rewrite it all from scratch. The documentation read like a bad narrative. "The program does this, the program does that", rather than "Determine raw data scores and differentials, store in table indexed by input and rank, etc. For KR coefficient, the following cannot be zero..."

    It turned out to be the smart move, because within a 3 years I had to recode it for another system, then another several years later.

    --

    A feeling of having made the same mistake before: Deja Foobar
  86. Team Environment by yintercept · · Score: 2

    It didn't sell anything and therefore the programmers were not productive? I don't think so.

    Hate to admit it, but the actually productivity of the entire company is a critical element in the success of the programmer. A programmer who's personality disorders (a good description of me) causes his products to be rejected one after the other is not productive.

    A coder might write extremely fast, clean efficient code, but if the code is not used for what ever political, personality or other problems that blocked the code then, in this sense, the programmer was not "productive."

    On the other hand, it is extremely productive for society to have a number of these risk taking initiatives in the works. The common figure that 90% of software projects fail is sad but not a total loss because the few successful products that evolve out of the fray generally make up for the loss.

    Here is a good question. If a KDE programmer ads a super cool feature to the product "yafflte" (yet another failed free linux text editor) and Microsoft reverse engineers the feature and includes it in Winword, who was the productive one?

  87. something missing by Darth_Burrito · · Score: 3, Insightful

    I feel like some intrinsic part of programmer productivity has been overlooked here. A lot of development is done in teams, working with groups of people. Sometimes a person can be of immense support to a team by providing insight, direction, explaining an existing system, etc... without writing a single line of code. I've known some programmers who never wanted to be bothered and others who became so swamped with people asking them questions that they sometimes had trouble getting their own work done. If Bill asks Rick a question, and Bill's answer takes an hour to explain, but saves Rick a day in wasted implementation, how does that affect the perceived productivity of Bill and Rick? Furthermore, how does this make you look at the productivity of someone who never wants to be bothered or someone who rarely asks questions even when they should?

  88. Function points? by markmoss · · Score: 3, Informative

    What is needed are metrics for estimating how hard the problem is, not how hard someone worked to solve it. For estimating the cost of writing a program in the first place, there are various measurements of the problem complexity. One is function points. Google found about 10 pages of links. Here is a FAQ (not approved by the function point users group) that discusses the use of function points to measure productivity, among other things.

  89. Three types of Code by hrieke · · Score: 2

    There is 3 types of code:
    Bad code - which doesn't work.
    Good code - which gets the job done.
    Elegant code - which can grow as the needs change.

    It is very very hard to write elegant code, and does require quite a bit of forthought, insight, luck and insanity to get it right.

    --
    III.IIVIVIXIIVIVIIIVVIIIIXVIIIXIIIIIIIIVIIIIVVIIIV IIVIIIIIIVIII...
  90. I see that you've seen... by BlackGriffen · · Score: 2

    The Agony and the Exstacy.

    BlackGriffen

    1. Re:I see that you've seen... by Anonymous Coward · · Score: 0

      That's ECSTASY. From the Greek. Today known as "E". But I'm glad to see someone else likes to watch Mike & Sixtus keepin it real

  91. Re:IBM Meeting (what about hardware?) by Anonymous Coward · · Score: 0

    Managers pull the same thing with percentages in hardware too though they deal with design coverage percentages. They LOVE to reduce everything down to a nice shiny little number which they can use to massage the actions of their underlings. Really, after a while it can get annoying where you think, "What Axis of Evil spawned them?"

    Interestingly, I've never ever heard any logic designer I've ever worked with utter a comment like, "I can write 5000 lines of VHDL/Verilog a day" because it's far more difficult to write RTL rather than something in an imperative/transaction based language. In addition, there are things like timing fixes which don't exist in software land: "Whoops, Billy Bob screwed me by loading down this net so now I have to do something else."

    Fortunately, hardware designers have a bunch of neat tools like model checkers and slop like that to make their life easier. Plus verification is critical for hardware..it's been estimated that 70% of the design effort is consumed by verification alone!

    And people wonder why I became an EE even though I really like programming too...I suppose it's because methodology is more prevalent in hardware design and that is one of the key things which helps one get a lot of work done quickly, fairly accurately, and consistently across a whole project.

  92. Refactoring! by phallen · · Score: 2, Insightful

    My personal favorite productivity measture: lines of code I've DELETED!

    Yeah, I know this isn't any new revalation either, but I'm a believer in Refactoring[?]: improving code without adding functionality. Refactoring improved efficientcy, understandability, and removed coded duplication.

    Read Martin Folwer's awsome book, and/or practice Extreme Programming[?], it'll change the way you program.

    ----------
    I can't spell. What else is new?

    --
    If Slashdot is where the spelling-challenged go when they die, I'm in heaven.
  93. In short... by PsiPsiStar · · Score: 2

    It's not the size of your code, it's how you use it that counts.

    --

    ___
    It's the end of my comment as I know it and I feel fine.
  94. This is a recycled article. by Webmonger · · Score: 5, Insightful

    The article originally appeared here last week. Sheesh. Don't pretend it's an original Slashdot article if it's not.

    1. Re:This is a recycled article. by chill_17 · · Score: 2, Informative

      it look like Charles Connell submitted this story himself, so what's the problem?

    2. Re:This is a recycled article. by NevarMore · · Score: 1

      no only did the author submit his own article, but another site is saved from slashdotting.

      sorry for the offtopic, but im taking a break from coding like ingrid.

  95. Another way to phrase the metric by laertes · · Score: 2

    I think the sign of a good piece of code is that it accomplishes it's goal with a minimum of code. I think a good way to measure this would be to track the rate at which a programmer increases the features to code ratio. Whoever does this faster is the better programmer.

    Still another problem is the short term variations in this ratio. All propgrammers bark up the wrong tree from time to time. Therefore, it only seems reasonable to check the programmer's productivity on a weekly basis, if not less even often.

    Anyway, at my company, we get along fine without ever reviewing the programmers. We are all just expected to produce good code in a timely manner. We don't set rigid deadlines, and we get bonuses for all of the projects we complete, with more money for bigger projects. Programmer productivity seems to be a fairly useless metric.

    --

    Yes, I'm still a junky. Are you still a bitch?
  96. She ordered what? by Anonymous Coward · · Score: 1, Funny

    What kind of engineer would get a DECAF mochaccino?? No wonder she fell asleep right afterwards...

  97. My two cents by gkirkend · · Score: 1
    Until the lifecycle costs of software - design, coding, testing AND support are considered, I do not think costs OR productivity can be accurately measured. I once spent six months "fixing" a production process so that it would work reliably. I have rarely seen a development manager get in trouble for producting a high-maintenance software product. In short, software still costs money after it is "thrown over the fence" to production.


    Greg

    --
    To a shark, you are just another food choice...
  98. This guy misses a lot... by BlackGriffen · · Score: 3, Interesting

    For instance, the assumption that lines of code = complexity is false. Ultimately, these are what matters in programming:

    How fast is the compiled program
    How big is the compiled program
    How easy is the source code to read
    How stable is the compiled code
    How secure is the program
    How complete is the feature set

    These are all about software quality, not quantity, though. Once you've measured qaulity, the only measure I can see for quantity is, "Did ya get the job done?" The key to measuring a programmers productivity, I think, is to have the programmer keep a log of what he's doing. With that log, the company can insist on improvement, a maintained level, give bonuses for productivity, etc. The only issue I could see with such a log idea is that the higher ups will become so obsessed with the log, and what the programmer is allowed to claim as a job done in the log, that the programmers won't be able to do their job. Oh, well, it was just an idea.

    BlackGriffen

  99. Bin Dere Dun Dat Don't Work by renehollan · · Score: 2
    This approach seeks to match a mean programmer productivity estimate against a mean program size estimate to obtain an expected completion date. the idea is that individual variances will cancel eachother out (you actually want programmers with different skill levels).

    One problem with this is that it requires an estimate of program size up front. This usually involves a rapid design phase to produce a set of classes, who's size is estimated, which, in turn, translates to lines of code per class. Unfortunately, this changes the goal of the design phase from a sound, robust design, to "hurry up and finish so we know how bit it is".

    Furthermore, while designs shouldn't churn too much, proper designs allow some latitude for change up front. This approach precludes that because it changes the project size estimates.

    --
    You could've hired me.
    1. Re:Bin Dere Dun Dat Don't Work by dbretton · · Score: 2

      Well thought out response. However, you are still missing the point. Perhaps I was not very clear.

      You state that one of the problems with this approach is that it requires an estimate of the program size up front. This is not a problem, this is the intent! Before you can successfully schedule a project, you need to have an accurate understanding of the project's size and scope (i.e. overall capability). Without this, you have no idea what you are building to, where to stop, and when to stop.

      You then conclude that this "...usually involves a rapid design phase to produce a set of classes...". This is not the case. In fact, if someone were to do this, it would immediately send off warning flags. The only time people should be rapid prototyping up front is if they are doing some initial pathfinding for a portion of the application that is very unfamiliar/new to them. Otherwise, I should be able to make a fairly accurate estimate without rapid prototyping, either by using metrics gathered from a previous task, or by drawing upon the knowledge base of my programmers, who have done something similar previously.
      (BTW, this approach has nothing to do with what language you choose, so it's really more of LOC/[capability] than LOC/[class/function/sub/etc])

      I would also have to disagree with your assessment of what the goal of the design phase. The goal of the desing phase is to produce a design which is sufficient and necessary to meet the customer's expectations for the end product. Many people would view these two as being identical, but in reality, they are quite different.
      Let's take a look at Microsoft Word. It is considered to be a staple-food type Productivity tool, and it is robust enough to satisfy just about everyone's needs. Let's suppose Word never existed, and a group of mathematicians asked MS to produe a document editing tool. Would MS go out and make Word? No. Most likely, they would have produced something that is a little more like WordPad, but with a very beefy equation editing engine. Would the design be sound and robust, like it (most likely is) in MS Word? Probably not, but it would make the engineers happy, as it would be sufficient for their needs.

      Anyway, getting back to the subject at hand. You said that the "approach" I gave precludes changes to the project size estimates. This is not the case. I discussed risk factors earlier. This is basically a cost/schedule variance which you will associate with every capability you plan to implement. Some have high risk, some will have low risk. The lower the risk, the more accurate your estimates are (pretty much anyone can give me an accurate LOC estimate for a "Hello, world" program, a low-risk capability).
      If I estimate a program to be 100,000 LOC in size, certain portions may vary in size, but, once all is said and done, the program will most likely be somewhere between 90K-->110K LOC. If it is far from that, then I must have made a mistake in determining the risk factor with some portion of the customer requirements.

  100. What about the Subjective Method? by Anonymous Coward · · Score: 0
    Pointy Haired Boss: "So, how productive do you feel you've been today?"

    You: "Well, sir, I feel I've been very productive today."

    ---------

    Slashdot me. I dare you.

  101. what is the point of this article? by AdamBa · · Score: 2
    The author throws out "lines of code" as a strawman measure of productivity, then proceeds to trash it (not too hard since everybody knows nowadays that it is bogus). Then he explains that he really doesn't know how to measure programmer productivity! Woohoo! Slow news day on slashdot??

    - adam

  102. KLOC? by LadyLucky · · Score: 2
    Am I the only person who would fail miserably on KLOC? thousands of lines? per day? sheesh. Unless you are doing new development, that's just schitzophrenic.

    I have had highly productive days where i wrote maybe 10 lines of code.

    Hoorah.

    --
    dominionrd.blogspot.com - Restaurants on
    1. Re:KLOC? by alyandon · · Score: 1

      I know the feeling. I spend most of my time gathering requirements from clients (whether internal or external) and doing design before writing a single line of code. In some cases I might prototype something without a lot of design effort just to show that something is feasible.

      After its all said and I have written the code it usually doesn't exceed an average of 10 lines per day for most short term projects I've worked on.

      Measuring lines of code written per period of time has to be the worst metric for trying to evaluate the productivity of a developer. I would much rather have my worth determined by whether or not I meet my boss/self assigned objectives in a timely manner.

  103. Essay Silly! Grad: D - by Anonymous Coward · · Score: 0

    Another attempt by someone to redefine how to overwork teenagers into coding your software? What is the point of this article? It so basic and obvious and seems only to say; "Write good code, write code fast, repeat". WTF!>?!!>?!

    Sophistic logic loops are bugs, not a basis for a business model or an essay. Let your programmers... program. Crazy as it sounds...

    Good code is just that... stupid. Defining proper "procedures" assumes writing code has anything to do with management wogs like you. I know the guy who wrote this is supposed to be the sheit here... but he reads like management.

    These are my comments on the issue, obviously, I find the essay above to be wrong in it's very existence. After all, these issues are old, as someone has wisely pointed out earlier. Not to mention the jingoistic silliness of implying that good coding is your duty as an American. Then you must please management with good coding, fast coding, and documentation. Then, Ingrid will Q&A and suck your joystick if you were a good little programmer.

    Man, sounds like Berlin 1939.

    I give this essay a BONG!

  104. True Productivity by Bilbo · · Score: 3, Insightful
    I was told by a wise Software Engineer long ago:
    True productivity in software engineering is measured by the number of lines of code removed per day.
    --
    Your Servant, B. Baggins
  105. Tony Hoare by Zeinfeld · · Score: 3, Insightful
    Tony Hoare said much the same thing about 15 years ago. I think it was his ACM lecture accepting the Turing award where he said that lines of code per day should probably count against the programmer. Come to that 'The Mythical Man Month' said much the same thing.

    I don't think anyone has ever claimed lines of code per day is a useful or meaningful measure, except of course for pointy haired bosses.

    --
    Looking for an Information Security student project suggestion?
    Try http://dotcrimeManifesto.com/
    1. Re:Tony Hoare by gmack · · Score: 1

      It's not. A good programmer can do in 5 lines what a bad one can do in 20.

      Unless of course slow and bloated is the overall goal.

    2. Re:Tony Hoare by Darren+Winsper · · Score: 1

      Ah, but then you end up with the situation of "obfuscated" vs "clean and readable."

      Look at this:
      #include <stdio.h>

      main(t,_,a)
      char *a;
      {return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
      main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
      )&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
      t,"@n'+,#'/*{}w+/w#cdnr/ +,{}r/*de}+,/*{*+,/w{%+,/w #q#n+,/#{l,+,/n{n+\
      ,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
      +k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){) #}w'){){nl]'/ +#n';d}rw' i;# ){n\
      l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
      n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
      ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
      # 'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
      :t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
      +1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
      i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
      (It's not mine, but I lost the URL of the author, sorry)

      It's very compact, but you cannot predict what it produces, nor could I figure out how it does it.

    3. Re:Tony Hoare by marko123 · · Score: 1

      A goodish programmer who can do 1000 unobfuscated lines of code per day will have produced something that 5 clever lines a day can't:

      maintainability

      --
      http://pcblues.com - Digits and Wood
  106. Ok, so I'm strange by MarkusQ · · Score: 3
    You need metrics to prove to clients that you can perform based upon YOUR schedule estimates, not thiers. (and we all know their estimates are "we want it done yesterday!")

    First off, metrics don't "prove" anything. But in any case, this generally doesn't come up because I don't discuss schedules with clients. I've found it is counter productive.

    The closest I'm willing to come is something like:

    Them: Can you have Wazzle-woo ready be the time our contract with XYZ corp come up for renewal?

    Me: We'll give you best-build-to-date a month ahead of time, and you can decide if you want to go live with it. That gives us time to make any small cleanups.

    Them: What if we don't like it?

    Me: Then you go ahead with XYZ for another year and you don't owe me a dime.

    If you think about it, the only reason I wouldn't be willing to work like this is if I expected to fail. Which I don't.

    -- MarkusQ

  107. The real question by Anonymous Coward · · Score: 0

    is how hot is Ingrid? She can streamline code and she goes to the health club - I think I'm in love!

  108. flamebait by Ironfist_ironmined · · Score: 1

    It's called Perl.

    Or `Obfuscated C'

    Hell, some even call it APL or Unlambda

    --
    0xC3
  109. empirical evidence not present by jilles · · Score: 2

    Some of the better pieces on program/project metrics include extensive case studies on multiple representative cases. The other ones usually aren't worth reading.

    Yours doesn't include any evidence whatsoever, just fictional examples that merely highlight how little you know about the subject. There's a lot of myths and misconceptions and myths about good programming practices and lots of people that spread them.

    Your estimate of productivity of 1 programmer per day ("5000 lines of code") is way off. Multiple, very good case studies have shown this to be between 1 - 10 LOC/day on large projects including all development phases. Unlike junior programmers, experienced software engineers typically agree with this number (I've heard several claim it was actually closer to 1 LOC than 10 LOC in their organization).

    I agree with you that LOC is not an ideal productivity measurement given the difference in programming language, programming style, program quality etc. There are many alternatives (e.g. function point analysis). However, LOC is simply the easiest to measure.

    In some of the more advanced software developing organizations I've visited (i.e. CMM level 2 and upwards) metrics (of all sorts) are used to steer the process. Consequently, the programmers in those organizations have nine to five jobs because management is able to acurately estimate the workload for a project. Also these companies have coding standards and review processes to enforce those. In addition, they measure defects/kloc so they know how good their code is.

    Good programmers get noticed in such environments because of their low defect rates, good quality code and good productivity.

    --

    Jilles
  110. And besides... by DrCode · · Score: 2

    ...lots of comments can vastly improve your daily lines-of-code count:-)

    1. Re:And besides... by Prowl · · Score: 1

      comments in code or comments on slashdot??

      =)

      --
      That man tried to kill mah Daddy
    2. Re:And besides... by blibbleblobble · · Score: 1

      Like when I was testing my self-documenting system (like manpages but for VB) and pasted the full text of Paradise Lost as a comment to test the system.

      Lines of code written today? 10,638

  111. What About *gulp* Function Points by CrazyLegs · · Score: 2
    Everyone agrees, KLOC is a dumb metric. It's something akin to Charles Dickens being paid for his stories by the chapter (true!) and so he produced extra-lengthy novels.

    Everyone would agree that the real 'metric' is a combination of factors that, in total, attempts to measure "how much of the spec was implemented how fast". This doesn't necessarily measure quality, which is a whole other topic.

    The idea of the Function Point methodology (been around for years) is to assign a metric based on total inputs, outputs, length, etc. etc. for an application. The number, on its own, is meaningless. Rather, it's a relative metric that over time will make sense within an organization. It allows you assign hindsight to foresight - i..e "That last project arrived under budget and under time and it's Function Point profile looked like this".

    It's not perfect, but it's not bad. It was given birth way back in the heyday of mainframe Cobol development, but has tried to morph into a scheme usable in other worlds (like OO development). And, there are still legions of believers who flock to User conferences, so FP must be doing something right.

    --

    CrazyLegs

    "Pork!!" said the Fish, and we all laughed.

  112. If you need comments... by cperciva · · Score: 3, Interesting

    If you need comments in order for your code to make sense, you need to rewrite your code.

    My personal measure of coder productivity is as follows:
    1. Take all the produced code.
    2. Remove all the comments.
    3. Present each function to a third party who is unfamiliar with the code, and ask them to explain how it works. If they can't, delete the function.
    4. If you have anything left, remove all formatting except linebreaks, and count the *distinct* lines of code. (Bad coders tends to cut+paste, which would lead to overcounting.)

    1. Re:If you need comments... by Anonymous Coward · · Score: 0
      If you need comments in order for your code to make sense, you need to rewrite your code.

      The naivety of this statement stuns me.
  113. CHoke! Learn C++ before teaching it! by Howling+Loon · · Score: 0, Flamebait

    Notably the RAII pattern, which these clowns appear to be totally unaware of.

    1. Re:CHoke! Learn C++ before teaching it! by epeus · · Score: 2

      We were writing about general principles, and illustrating them with C. RAII has the same issues regarding allocation as we discuss in the article, moved up one layer of abstraction - you still need to make sure that all the objects you create (explicitly or implictly) are deleted in the error case.

  114. Absolute Bullshit. by foqn1bo · · Score: 1


    Is it lines of code per day? Lines of good code?

    One answer. Quality Not Quantity(tm)
    At the very least this means lines of good code, but in actual practice don't we want efficiency? That is, with each block of code shouldn't we want to do as much as we can while still maintaining readability and stability? I think that people are getting confused about the appropriateness of the word 'productivity' in this discussion, since in essence as long as you are simply counting lines the word you are instead looking for is 'prolificity'.

  115. What a horrible article by dmccarty · · Score: 2
    Danny's code probably will be easier to extend and modify, and likely will have a longer lifespan, because of its compactness.

    Ah, yes. Such as this "compact" solution to the n-queens contest: int v,i,j,k,l,s,a[99];main(){for(scanf("%d",&s);*a-s;v =a[j*=v]-a[i],k=i=s*k&& ++a[--i]);printf("\n\n");} Very easy to extend and modify, no?

    Charles Connell is president of CHC-3 Consulting, teaches software engineering to corporate and university audiences, and writes frequently on computer topics.

    Uh, remind me never to take any of your classes.

    --
    Have fun: Join D.N.A. (National Dyslexics Association)
    1. Re:What a horrible article by Tralfamadorian · · Score: 1

      And using equally outrageous logic: turning that program into a 200,000 page program would make it SOOO much easier to read and maintain.

  116. EMACS? by Howling+Loon · · Score: 1

    Nah, writing V1 in TECO is what did it.

  117. One example by Pinball+Wizard · · Score: 3, Interesting
    At the moment I'm trying to find the best algorithm for finding the common elements between two arrays.


    I could go the easy route and check every array index in the first array against every array index in all the other arrays. For all I know this is the most efficient way to do this.


    But, instead I'm going to research some algorithm books and see if I can't find a more efficient way to retrieve the common elements.


    I may very well end up with something that takes a lot longer to code and has less lines of code than the brute-force compare-every-element-against-every-other-element method. But if the payoff is faster, tighter code, then my research and extra coding time will have paid off. However, to the untrained eye, it may look like I'm spending more time to produce less code.


    If you are a manager reading this, remeber, the best solution may take longer and contain less code than a suboptimal solution! You have to think hard if you are going to try to quantify this - because nobody knows off the top of his/her head what the best algorithm for everything is. If you have a programmer who regularly researches the efficiency of the algorithms they use you will probably end up with a lot happier customers than if you just have people who bang out code without thinking hard about what they are doing. Unfortunately, doing things the right way makes the programmers job harder to quantify.

    --

    No, Thursday's out. How about never - is never good for you?

    1. Re:One example by Anonymous Coward · · Score: 0

      Perhaps a quick-sort, followed by bruteforce would result in less comparisons.

      Why : because the bruteforce step can be significantly smaller because you can efficiently eliminate large chunks of the arrays.

    2. Re:One example by cybaea · · Score: 2

      Sheesh:

      #!/usr/local/bin/perl -w ## Let @a1 and @a2 be the source arrays, @r is the result my(%m);
      grep ($m{$_}++,@a1);
      my @r = grep($m{$_}, @a2);

      Easy :-)

      --
      Hi!
    3. Re:One example by Anonymous Coward · · Score: 0

      Compare-each-element is terrible, especially if you want all matches. But if one of the arrays is *definitely* known to be small, then it is fine to use this.

      Sort is easy and much faster. In C and many other languages qsort already part of the standard library, just waiting for a job to do. Plus having the arrays already sorted may make other tasks simpler.

      But if you want a VERY fast way to get all the matching elements, there is a still better way. But I'm not telling you what it is... nyah nyah

      Instead, I'll make a nice meal from yesterday's leftovers. I just do adore a good corned beef hash.

    4. Re:One example by keramida · · Score: 1
      > At the moment I'm trying to find the best
      > algorithm for finding the common elements
      > between two arrays.

      The best way might depend on what the "values" of the array elements can be. But your point is well put and clear. It also falls under the "quality is more important than quantity" part of the original article.

      There are other things that one might consider important too. At the FreeBSD committer's guide there is a part that reads:

      Being able to work together long term is this project's greatest asset, one far more important than any set of changes to the code, and turning arguments about code into issues that affect our long-term ability to work harmoniously together is just not worth the trade-off by any conceivable stretch of the imagination.

      Therefore, the metrics one will use to find out who is productive and who is not, are closely related to those things that are deemed important for the project/company/group at hand.

      • Quality of code?
      • Quantity of code?
      • Documentation of code?
      • Simplicity of code?
      • (Small) size of code?
      • Comments or no comments?
      • Not missing deadlines?
      • Maintainability of resulting code?
      • Choise of the proper tools?
      • Being able to report to managers?
      • Working harmoniously with others?

      These are a few of the things that might need to be considered, when asking "is John Doe as productive as we wish him to be?" Several of them are conflicting with each other too. I'm arguing that before one chooses metrics to start checking who is productive and who is not, there is a need to define in clear and simple words what the "targets we have" are. I'm deliberately choosing "we" here, to emphasize that the targets are something that is a property of "the team" that includes both managers and programmers.

      It is very important to know what the team strives for. Then, after the message has been passed to the hordes of programmers, a choise is made about the metrics. Bearing in mind that it's well-known what is "getting us closer to our aims" now, the choise of appropriate metrics is bound to be easier.

      Giorgos.

      --
      My other computer runs FreeBSD too.
    5. Re:One example by mat.h · · Score: 1

      I could go the easy route and check every array index in the first array against every array index in all the other arrays. For all I know this is the most efficient way to do this.

      But, instead I'm going to research some algorithm books and see if I can't find a more efficient way to retrieve the common elements.

      Or find yourself a quiet corner and do a tiny little bit of thinking. Then do the equivalent of sort | uniq -d. Done. Time complexity: O(n log n).
  118. Normalized LOC by metalogic · · Score: 1
    Here is an idea:

    Define a standard task of medium complexity; ask all your slav^h^h^h^h programmers to solve it and obtain the per task LOC for each programmer, PTLOC(ProgrammerX). Then normalized-LOC, NLOC(ProgrammerX) =def LOC(ProgrammerX)/PTLOC(ProgrammerX).

    Now you have a relative productivity measure of all your programmers.

    1. Re:Normalized LOC by ahde · · Score: 2

      if my programmers aren't slavic, they must be indian or chinese.

  119. Shamelessly lifted from "The Tao of Programming" by jlower · · Score: 1

    The Tao gave birth to machine language. Machine language gave birth to the assembler.

    The assembler gave birth to the compiler. Now there are ten thousand languages.

    Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.

    But do not program in COBOL if you can avoid it.

  120. Zoning out sitting in the shower by Howling+Loon · · Score: 1

    with the water playing on the back of my neck... no time passes... and viola! A solution!

  121. Does anyone count lines of code anymore? by Greyfox · · Score: 3, Informative
    I've never worked in a company where lines of code were counted. Generally requirements are specified by the customer, we estimate time to code the requirements and requirements completed is the measurement we tend to go by. Every once in a while we miss one and the schedule gets pushed around. If you never manage to complete a requirement, you're not being a very productive programmer.

    The larger teams also have code reviews, so if a programmer's code leaves something to be desired, they can say so in those meetings and send him off to fix the problems they highlight. Said meetings understand that programmers of varying abilities work on the team, but they allow the team to address the most obvious shortcomings in someone's code.

    A testing cycle is also required to insure that the programmer's not just saying he completed the requirement. Not much point in submitting code as complete if it doesn't operate as per the requirement's specification.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  122. Re: Rothko and Van Gogh by ahde · · Score: 1, Redundant

    It's bad form to use an analogy that refutes your argument, but it shows guts!

  123. How do you gather the metric? by paddlebot · · Score: 1

    I always thought that the only really good thing about measuring LOCs was that the number was easy to gather. Yes, the meaning is limitted. Yes, the number of lines you produce changes dramatically regarding where you are in the lifecycle of a project. Yes, the numbers are next to meaningly when comparing different languages or different developers. But you can calculate it easily. Pretty hard to measure the quality of the approach.

    So the metric has value when used with care and caution.

    If you are in a junit environment, doesn't measuring test cases passed really give you the best idea of progress?

  124. Not LOC, but HIO by richieb · · Score: 3, Informative
    I have yet to see a manager look at "lines of code" as any type of measurement. Has anyone?

    However, I still lots of people's effor being measured by HIO (Hours in Office).

    --
    ...richie - It is a good day to code.
    1. Re:Not LOC, but HIO by chris_mahan · · Score: 1

      Absolutely.

      I can spend an entire day in the office not writing a single line of code because I'm (bored/tired/upset/distracted/hungry/horny/sick/di zzy/unable to focus/depressed/demoralized/PickYourOwn) yet I get in the car, stop at a red light, look at a tree on the side of the road, at 5:45 PM, and get a beautiful flowchart in my head of the entire process and all dependencies, with near-complete code to go with it (heck, even the functions and arguments pop into my head) yet I'm nowhere near capable to write it all down, and as the light changes to green, I have to forget all about that so I can concentrate on not plowing into the lexus in front of me.

      Yet, I'll still get paid, and my boss with "assume" --incorrectly--that I was productive.

      Also, a lot of time, I'll write code based on diagrams and notes I wrote the night before while at a coffee-house, or after dinner. Do I get paid for that? Of course not. So I don't feel horribly guilty (not guilty at all really) for reading /. and various other web sites while at work.

      --

      "Piter, too, is dead."

  125. Waaah by Anonymous Coward · · Score: 0
    You didn't do what your manager wanted, you almost got fired for it, and now you complain here?

    If you want to work differently from everyone else, you'd better EXCEED what others are doing, not just make sure "the features I was working on was completed on time".

    1. Re:Waaah by blue+trane · · Score: 1
      so, working the same as everyone else is good in and of itself, regardless of whether one person might work more efficiently with more flexible hours?

      Personally I empathize with the parent poster; I too find the office setting less productive because of all the distractions.

      One day maybe bosses will realize that people who work better in a non-office setting can contribute to the company bottom line. These people are not necessarily "slacking off" or "stealing from the company"; you have to go beyond appearances and look at the work that is actually getting performed.


      The flip side of course is that managers can take time off and work from home whenever they want...because they're managers, I guess.

  126. By conventional methods I'm negative equity by Anonymous Coward · · Score: 1, Interesting

    In 5 years I've deleted more lines of other people's code than I've written myself, but most of the stuff I do is redistributing someone's functional implementations.

    The result?

    1. Less bugs due to less lines of code. Bugs are easier to spot.
    2. More code reuse.
    3. More readable.
    4. smaller binary size.
    5. Faster (mainly 'cos you can see what it's actually doing)

    The ultimate irony is the point that the code runs faster. Normally people have written 'optimisations' which are unreadable and don't quite work as expected, so they compensate elsewhere...

  127. Productivity by Anonymous Coward · · Score: 0

    Evgeryone seems to have missed the BEST measure of productivity:

    How many Other Programmers are lined up trying to steal the Credit for the good programmer's work.

  128. Comments by naming by Howling+Loon · · Score: 4, Interesting

    I like commentParserDatabaseCursor. I also like i, j, p, and retval. The length of an identifier should be roughly proportional to the log of the size of its scope. A file scope "i" is an abomination. A loop scope "commentParserDatabaseCursor" is an idiocy.

    1. Re:Comments by naming by mrpotato · · Score: 2

      damn good point buddy

      --

      cheers
    2. Re:Comments by naming by Xtifr · · Score: 1

      A file scope "i" is an abomination.

      Absolutely.

      A loop scope "commentParserDatabaseCursor" is an idiocy.

      That would tend to depend on how obvious it is what the code is doing. If you start your loop with "i = commentParserDatabase.startingCursor", then surely "i" is sufficient. If it's not obvious from context what "i" is, though, then maybe you should go ahead and use "commentParserDatabaseCursor" instead. Or maybe you just need a comment like: "iterate over the comment database".

      Bottom line, programming is neither an art nor a science, but a craft that requires both good technical skills and good communications skills. If you have only the former, you may write fast, solid but unmaintainable code. If you only have the latter, you can write easily maintainable but fundamentally broken code which may be easier to toss than to fix, even though it's clear.

    3. Re:Comments by naming by Rogerborg · · Score: 2
      • The length of an identifier should be roughly proportional to the log of the size of its scope. A file scope "i" is an abomination. A loop scope "commentParserDatabaseCursor" is an idiocy.

      Why is that, exactly? You're a particularly slow typist or reader? Or you expect the code to never be read again?

      The longer I work in the industry, the more I become aware of the Zeroeth Law of coding. Understand who your audience is.

      You are not your audience. It's necessary that understand the code as you're writing it, but not sufficient. Your peers are not your audience. Your reviewer is not your audience. The compiler is not your audience (or we'd use variables like "_" and "__").

      Your audience is the poor shmuck fresh out of college who gets your code dumped on her in five, ten, or twenty years, long after you and anybody else who worked on it has left for pastures new. Anything - anything - that you can do to help that person out should be done. To do less, to make any assumption about their ability or experience, to make statements that this is stupid, and that is an abomination, is egotistic arrogance of the worst sort.

      Feel free to demonstrate that I'm correct by taking that personally and responding angrily. Ego has no place in coding.

      --
      If you were blocking sigs, you wouldn't have to read this.
  129. Not really by Anonymous+Brave+Guy · · Score: 2

    As a general rule, clean and short code is easier to read than clean and long code. For example, which of the following is easier to read (assuming you know C)? This?

    if (daytime)
    {
    skyColour = blue;
    }
    else
    {
    skyColour = black;
    }

    Or this?

    skyColour = daytime ? blue : black;

    There's not much arguing that using the ?: operator is idiomatic in C or C++; many procedural and OO languages have no direct equivalent. And yet, when used correctly (!), it can tidy up half a page of code into a line or two. It's also more semantically meaningful; the above code is assigning a value to skyColour depending on some condition, and IMHO it's clearer to attach the condition to the expression being assigned than the whole statement.

    There are much more powerful versions of this idea (see "pattern matching" in ML, or "regular expression processing" in Perl), where using an idiomatic feature of the language in an appropriate context makes for code that is shorter, easier to read and more meaningful than a more naive "longhand" equivalent. Sometimes it requires a basic familiarity with the language -- the syntax of the constructions mentioned here isn't obvious to those who don't know -- but to any reasonably experienced programmer, short and clear is likely to be better than long and tedious.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Not really by Tony-A · · Score: 2

      Not so much idiomatic as stinky syntax.
      Idiomatic would be to cast the boolean into cannonical form and use that as subscript for an explicit array. Something like (with corrected syntax):
      skyColour = {blue,black}[daytime];

      C:
      skyColour = daytime ? blue : black;

      Algol68: *two* syntaxes for same thing.
      skyColour := if daytime then blue else black fi;
      skyColour := (daytime|blue|black);

      Lisp: something like
      (setq skyColour (cond (daytime blue) (t black)))

    2. Re:Not really by PigleT · · Score: 1

      Depends entirely what you're going to want to do next with it.
      The ?: operator (which is totally a C idiom) is not readily expanded if you decide you want to go off and shove extra bits in the `then' clause - for which your `if..else' example has space a-plenty.

      (Yes, I'd've missed out the { } in the if/else version, on the grounds that if I wanted to put more stuff in, I could put them back.)

      --
      ~Tim
      --
      .|` Clouds cross the black moonlight,
      Rushing on down to the circle of the turn
    3. Re:Not really by Anonymous+Brave+Guy · · Score: 2
      The ?: operator (which is totally a C idiom) is not readily expanded if you decide you want to go off and shove extra bits in the `then' clause - for which your `if..else' example has space a-plenty.

      That's a very good point, and one often missed when people first learn about the ?: operator. It's only really suited to a boolean condition that's naturally going to remain so. It either is daytime, or it isn't. However, it's not (usually) a good choice if your condition is something like colour == red. At that point, something like an associative array is a better option in C++, pattern matching kicks in in some other languages, or you could use good old switch if it fits.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  130. Classical winging bosses by DrSpin · · Score: 2, Informative
    If you wer to read art history instead of slashdot, you'd know that for most of his life. Maichaelangelo's bosses were indeed winging that he took too long, kept changing his approach, and used too much materials.

    He may have been a genius, but his bosses weren't.

    And you wont get good code written from programmers who are underpaid, and pissed off either (but sex-starvation doesn't appear to do much harm to code productivity or quality.)

    1. Re:Classical winging bosses by xski · · Score: 1
      (but sex-starvation doesn't appear to do much harm to code productivity or quality.)


      Yes, well, we all have hands now don't we?

    2. Re:Classical winging bosses by Loligo · · Score: 2

      >(but sex-starvation doesn't appear to do much
      >harm to code productivity or quality.)

      Sure seems to be hell on spelling, though.

      -l

  131. true enlightenment by archen · · Score: 5, Funny

    Boss: How many lines of code did you do today?
    Coder: 1
    Boss: [next day], how many lines did you do today?
    Coder: 1
    Boss: [day 3] how many lines did you do today?
    Coder: 1
    Boss: how come you only do one line per day
    Coder: Actually I'm working on the same line.
    Boss: How many lines is the damn program?!?
    Coder: 1
    Boss: You're programming in Perl again arent you...

  132. Worked with a guy... by Anonymous Coward · · Score: 1, Insightful

    who could do a 90% solution to a problem in days that would have taken any one else weeks. There were two problems with him: he knew he was that good and it took the rest of us weeks to finish his code.

    Just another post below my threshold.

  133. It could be worse... by hafcaf · · Score: 1

    Actually you could have mgmt that doesn't even know enough to debate whether or not they should have productivity metrics.

    Of course, they stay off your butt b/c they are clueless.

    --
    -hc- I always get the shakes before a drop...
  134. Getting away from a problem by Tim+Ward · · Score: 2, Insightful

    Getting away from a problem sometimes is a good way to solve it.

    Works for debugging, anyway.

    Once upon a time we were stuck for ages with a horrible bug, and were making no progress. I went home for a bath (don't remember at this distance why I thought that was necessary), and in the bath worked out what must be going wrong.

    On returning to the office I got some coffee and wandered over to my desk, ignoring the group of people still huddled round the minicomputer. After a few minutes I looked up and said "You have fixed, it haven't you?". "No", they said.

    So I told them which module to look in, and then which line of code was wrong, without the listing in front of me, and for no apparent reason they got quite cross when they discovered I was right.

  135. Ah, so that's why so many companies think... by mikosullivan · · Score: 3, Funny

    ... that Java is better than Perl. It takes so many more lines of code to do the same simple thing. 'splains everything.

    --
    Miko O'Sullivan
    1. Re:Ah, so that's why so many companies think... by metacosm · · Score: 1

      OR... it could be that java has lots of industry support, has a great library, scales well on the server side, and is (mostly) true OO rather than ugly bolt on hack OO like perl.

    2. Re:Ah, so that's why so many companies think... by Anonymous Coward · · Score: 0

      *laughs and points*

      JOKE. J-O-K-E. Look it up.

  136. yes, really (Re:Not really) by Anonymous Coward · · Score: 0

    if (daytime) skyColour = blue; else skyColour = black;

    if (daytime) skyColour = blue;
    else skyColour = black;

    skyColour = daytime ? blue : black;

    //SkyColour = look out the damn window and know for yourself!

    1. Re:yes, really (Re:Not really) by blibbleblobble · · Score: 2

      Hmmm... VB can be used to obfuscate more than that surely?

      SkyIsDark = (TimeOfDay = Night)
      'Brackets optional, but help not to confuse C programmers

      SkyColour = QbColor(SkyIsDark * 10)
      'Don't forget you can multiply by booleans, and use an obscure colour scheme.

      Liberally mix Colour and Color functions to confuse Americans, and you're nearly there...

      But don't call me Shirley

  137. Stupid HP ad blocked start of article by Anonymous Coward · · Score: 0

    I hate to complain, but now slashdot is becoming more like most other annoying web sites cluttered with distracting advertising. Is there software that can block these annoying "pop in" type ads?

  138. Well written by McG33k · · Score: 1

    Thank you for your insight! I'm going to hold onto this one just incase I have to show a prospective boss in the future :) --g33k

  139. linux issues by Prowl · · Score: 1

    wasn't the latest incarnation of the linux VM written "fred fastfinger" style...?

    also, there is a giant grey square in the middle of this thread. wtf??

    --
    That man tried to kill mah Daddy
  140. You measure it with $MONEY$ by ezfur · · Score: 1
    You measure how productive a programmer is by how much money they make. The more value they add the more they are worth.

    Example Fredy FastFingers produces 5,000 lines of perfect optimized code a day, but if he only makes $30,000.00 a year then he is an idiot and who cares!

  141. It's not about KLOC, but everyone does it by gnobal · · Score: 1

    A boss of mine once said: "No one likes counting KLOC, but everyone does it". Have you ever worked in a big company that didn't count lines of code? I haven't.

    But, as a programmer, there are two things I really like doing with existing code: adding consts and removing duplicates ;)

  142. OT Re:One example by Anonymous Coward · · Score: 0

    Completely off-topic, but I'm amazed Mozilla displays that correctly. Source should have been

    #!/usr/local/bin/perl -w
    ## Let @a1 and @a2 be the source arrays, @r is the result
    my (%m);
    grep ($m{$_}++,@a1);
    my @r = grep($m{$_}, @a2);
    1. Re:OT Re:One example by The+Evil+Beaver · · Score: 1

      And _why_ is it so amazing that Mozilla displays that correctly?

      Hmph.

      --
      Chris 'coldacid' Charabaruk Meldstar Entertainment
  143. in other news... by galore · · Score: 1

    goto considered harmful.

  144. Here's what you do... by Anonymous Coward · · Score: 0

    write ONE really good line of code per day.

  145. Productivity, efficiency, longevity by WilliamsDA · · Score: 1

    I work for the Navy, and I'm not sure if this is just a Navy, DoD, or industry standard -- but we predict 1 man-hour per line of code. Of course when I first heard that I thought about how slow that was, but it makes more sense now (e.g. lifetime of the code, maintenance, training, reading, etc.). Does anyone else work for a place that puts a price or predicts time per line of code? If so, I'd like to see how it compares to the Navy.

  146. Productivity is by webprogrammer · · Score: 1
    Productivity =

    (p / l) * d

    where:

    p = problems solved
    l = average lines of code needed to solve problem.
    d = average amount of comments per problem solved.

    The new unit of productivity: problems solved per lines of code-documention.

    --
    Tim ODonnell (trying to be the most
  147. Not always.. by Axe · · Score: 1
    ..On anything but the most critical portions of the code I greatly prefer to have 10 lines instead of 5 - with good comments to them. Makes for a much easier to understand - and ultimately more efficient code. I hate all this ++i=j++; style hacks - god damn, write it out in three lines and comment. You can prove how clever you are by wining obfuscated C contest, not by testing you collegues and yourself patience. (and, yes, I can write and understand ultra hackerish code myself just fine, thank you) Ultratight C and Co. code is bad.

    To sum it up - efficient code is not 5 lines instead of 20. It is 500 lines of good design instead of 1000 of uncommented hack.

    --
    <^>_<(ô ô)>_<^>
    1. Re:Not always.. by gmack · · Score: 1

      I mean smaller not obfuscated. And I agree ...crap like you just posted is usually on the first list of things to hit the chopping block when I'm debugging other people's code.

      This has *nothing* to do with comments either since I tend not to count it as code and I'll bet neither do most PHBs

      I've worked on projects where my *readable* code + comments. Turned out to be less than a third of the unreadable sludge that it was replacing.

      The odd thing is the sludge is where I most often find clever code compactions like the one you listed as a bad example.

  148. my perfect measure by joto · · Score: 2

    lines_of_code_added + 2 * lines_of_code_deleted + 0.9 * lines_of_code_changed -10 * needless_changes_or_additions+number_of_minutes_ex plaining_difficult_stuff_to_coworkers_needing_help + some_constant * amount_of_great_ideas_improving_the_design_of_the_ product + some_really_high_number * solving_some_really_tough_problems + some_reasonably_large_number * solving_some_moderately_hard_problems + some_pretty_low_number * solving_relatively_trivial_problems + some_large_constant * obscure_knowledge_of_esoteric_topics_helping_impro ve_the_design_of_domain_specific_code + some_other_large_constant * ability_to_write_clean_and_efficient_code_for_both _trivial_and_complex_programming_tasks + some_moderately_large_constant * not_having_a_gigantic_ego_and_be_willing_to_accept _other_peoples_solutions_when_they_are_better + another_large_constant * ability_to_understand_business_objectives_and_espe cially_the_needs_of_clients_and_apply_that_to_the_ task_at_hand + lots_of_other_factors_i_probably_have_forgotten

    1. Re:my perfect measure by keramida · · Score: 1
      lines_of_code_added + 2 * lines_of_code_deleted + 0.9 * lines_of... [snip huge variable names]

      nice style. exactly the kind of clear, small, simple and easy to follow code, that the article is talking about :-P

      /me with tongue in cheek

      --
      My other computer runs FreeBSD too.
  149. What makes a programmer productive? by SeattleSluggo · · Score: 1

    * an office with a door
    * the best tools
    * minimal interruptions
    * minimal meetings
    * reasonable schedules

    Fuggit about measuring anything, you'll only
    get what you measure.

  150. Communication, not classical measures. by Mr.+Fred+Smoothie · · Score: 2
    He should be able to figure out how long it would take to finish a statue of somebody my size
    What if he's never made a statue of a human before, but he's done lots of ducks, elephants, buildings; do you trust his rough estimate knowing that it's *completely* speculative?
    Just as a programmer should be able to estimate how to finish a project if he knows what's involved up front ... also, changes to the design should be expected to set things back.
    Given that changes to the design are almost inevitable, particularly if the speculative duration of the project is long, this further reduces the value of the speculative estimate to the point that even calling it a ballpark is woefully misleading ("the world is my ballpark").

    Really, the most successful software projects are going to be ones where:

    • The development is iterative, the only solid dates -- at least early -- are the ones for the next couple of iterations (or management and users understand that if the end date is solid the feature set can't be), and users and management have enough daily, non-disruptive involvement in the project to understand "the code count went down, and had a definite positive impact on the project."; Or
    • The date shipped is the only thing that matters and the organization is willing to burn through people and sacrifice efficiency down the road
    Note that from a software engineering perspective, the latter approach seems invalid, but from a business standpoint it's possible that it's correct given certain market conditions (though personally I doubt it's valid even from a business standpoint if the software in question has long-term importance for the company).

    If one absolutely needs a concrete measure of progress, it should be growth in the feature/bug count ratio.

    --

  151. Useful information content by iabervon · · Score: 3, Interesting

    You want to measure documentation separately, because it obviously isn't used in the same way as code.

    For the code, the metric you'd actually like is something like number of useful, novel expressions.

    Copying a section of code doesn't add anything, because the lines aren't novel. Any changes you make to the lines do count, though. Making an existing block of code into a separate procedure adds a novel expression, and the expression is useful if you call it from multiple places (i.e., if the procedure is a useful abstraction). Calling a procedure with a new set of arguments is novel and generally useful.

    Basically, you want to know how long the day's work had to be, given the pre-existing code, if it was done optimally.

    If you add a penalty for making the code needlessly long, then a day spent reworking bad code to be shorter by combining common expressions, removing extraneous computation, etc, will also be considered productive.

    For the documentation, it is easier to consider but harder to quantify. You are now measuring the number of correct and useful pieces of information that a person would get out of reading the commented code. The information may, of course, be obvious from the control structure, implied by the variable names, or actually in comments; since comments add to the length of the code without adding any functionality, using coding idioms that the reader will know (because they're part of the company's style guide or common throughout the code) and informative names is better than putting in comments, unless it is impossible (which is frequently the case).

    Of course, it's hard to quantify "pieces of information" and hard to judge objectively what can be gotten out of a block of code, which is one reason this isn't something you can set up cvs to do each day or something.

    This means that the ideal block of code, which should be counted as the most possible for a given problem, has these properties: it (or an equivalent block) has to be there in order for the project to do what it's supposed to do; it is not replicated, in whole or in part, anywhere else in the project (if it did, it would do better to call the other part); its behavior is clear from the names of the procedures, variables, and types; any common algorithms are implemented in the standard ways; and unusual algorithms are commented explicitly.

    I think this metric would measure productivity effectively. Of course, it doesn't help productivity to actually try to measure it.

  152. Isn't this just like typing class? by teamhasnoi · · Score: 1
    I had a friend back in high school who could whoop ass in typing class (that's what we called it, in those Apple 2+ days) We did this on good ol' IBM Selectrics.

    Anyhow, he could type 70+ word per minute. The next fastest were two people who maxed out at 50 +/- wpm. One of these people got an 'A' and the other got a 'B-'. The difference? The 'A' student made very few mistakes. The 'B-' student spelled like most Slashdotters.

    My pal who could do 70 wpm? He made about one error per page. He was a machine! :)

    Me? It took me 3 days to type this. :P

  153. Putting comments in their place by tinkerton · · Score: 2, Insightful

    One of the guidelines I have to find code to refactor : look for comments. Comments should be in the checkin log of the file, in the changelog of the project , in the header files and in the naming of variables and functions. And in the diff between revisions.

    If they are in the code you have a good chance to point out weaknesses in the code. Occasionally these are weaknesses that are very hard to avoid. Often not.

    Which leads to guideline two: always try to upgrade the clarity of the code when you do a small mod(usually a fix) . Small mods tend to degrade the code quality, the maintainability, even though the code works better than before.

    Comments in the code also quickly become irrelevant, and even misleading, if they aren't already bad from the start. So take a weak fix and append a confusing comment ,and you get a very recognisable frustration. Only, the solution for it is not 'better comments'. It's better code

  154. Would you hire someone with no coding experience? by GMac · · Score: 1

    Obviously there is some value to the metric, however programming skill is not a function of one variable :)

    I wonder how many bad pieces Michelangelo did before he did a good one? Did he copy other people and then modify his style as he progressed? Did he just do one piece or was he prolific?

  155. Apply this to BSD and Linux by Anonymous Coward · · Score: 0

    If I can upgrade Linux to FreeBSD and get all
    the benefits of Linux 3.x w/o writing a single
    line of code, because it's already in FreeBSD,
    then I can save the computer world a lot of
    reinventing the OS.

  156. Not me by DigiitalWiz · · Score: 1


    The company I work for doesn't base my work on the LOC of code.
    This is how it works. But alittle background first. The company I work for creates billing/customer care software for cell phone comp's. The applications we have aren't out of the box. Each site is totally different.

    Anyways. First the customer requests a change or new feature, a impact assessment(IA) is created with what's going to be changed and if any possible problems with current functionallity.
    Once the Customer has reviewed the specs, they write off the IA and then it's my turn. I then review the IA, I then rewite a detail design document laying out what objects I'm going to change(btw the application I work on is done in Powerbuilder) size of labels/colors/datawindow.... Once thats done, then I write out Unit test cases in TestDirector(http://www-svca.mercuryinteractive.co m/products/testdirector/) based on the IA. Basicly this is based on the Detail design, so it's how i verify that the new label I added is in fact BOLD and in RED, it also verifies that I haven't forgotten anything. THEN it's off to writing the Application Test Cases, which is, once the application is compiled, of course to verify that everything the client wants is there.

    AFTER thats all done, then I code. So 3 weeks that was given to me for this project, 50-60 is writing out documentation(not like I enjoy writting documentation.) then it's off coding, which has been done already while creating the Detail Design. Then it's off testing Unit and Application test cases.

    97% of the time there are no bugs sent to the client and 99% what they asked for was added and working.

  157. Don't think too much by Mr.+Fred+Smoothie · · Score: 2

    about possible future problems. There are an infinite number of them. Unless you have an infinite amount of time before the project is due, focus on sound architecture, taking care of the "obvious future problems" if any, and let refactoring fix those "possible" problems if and when they ever arise.

    --

    1. Re:Don't think too much by jmccay · · Score: 2

      Agreed, but the small amount of may not even include those. I have see a lot of code that didn't bother to handle even the simplest of possible problems that wouldn't fall inside the take too long to figure out or take care of.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
  158. Measuring coders' productivity just doesn't work by casmithva · · Score: 4, Interesting
    Over my years in the business I've encountered the following means of measuring a programmer's productivity:

    Number of lines of code written, highest score wins. In short, why write in 100 lines what you can write in 1,000?

    Number of lines of code written, lowest score wins. You end up with your own obfuscated coding contest. You might also find people rewriting other people's work, redesigning APIs and other infrastructure components, for no reason other than to lower their own score. This can lead to total chaos, fights in the parking lot, etc.

    Number of good lines of code written a month. What's the definition of "good," and how subjective is it? If it includes comments, then how is the usefulness of a comment determined? I've seen developers write more comments than code, and in the end the comments said nothing useful that would've helped a new developer maintain the code.

    Number of bugs fixed in a month. The programmer who spent a month researching the sev 2 bug that was affecting system availability or data integrity for the last three months isn't recognized for his/her achievements, while the intern who fixed 100 bugs pertaining to typos on the website and in the documentation is rewarded.

    Number of bugs created in a month, lowest score wins. Nice idea, punishing people for creating bugs, but people might get so paranoid about causing bugs that the turnaround time for code is obscenely high.

    Code complexity metric, lowest score wins: All this proves is that the programmer's capable of writing non-complex code but says nothing about the documentation for the code, the overall design of the component or subsystem the programmer was working on, etc.

    Number of tasks completed in a month. This screws the guy who's got a hefty task that cannot be divided any further or the programmer waiting on the sysadmin to install the necessary development tools so that he/she can actually get started.

    Customer satisfaction. The customers are pissed because the website is unstable, but the rest of the back office system is running perfectly fine. In the end, everyone -- the back-office developers, the database guys -- is punished when only the website people should've been put on call center duty for a week.

    Number of customer issues resolved. There's a great incentive here to solve issues with kludgy hacks which, in six months to a year, might leave the company with a very flaky, unmaintainable system.

    360-degree input, or "Mutually Assurred Destruction". This was a system IBM used -- still uses? -- where your peers, some picked by you, some by your manager, would fill out a survey and offer opinions about you. The manager would then piece it all together and come up with a result. Like Dilbert called it, it's "mutually-assurred destruction," although I saw it work the exact opposite way many times.

    There's so much more that goes into developing and delivering software than just writing lines of code. And the number of lines of code written isn't all that significant if the design sucks, if the documentation is unusable by the people who need it, if the call center people supporting the thing aren't trained properly, or if the systems supporting the website or the database are unstable. How do you put a score next to a name when many of the things contributing to that score are subjective or out of the control of the person being scored? We're not building CD players here!

  159. Was that all? by matsh · · Score: 4, Insightful

    This guy is "president of CHC-3 Consulting, teaches software engineering to corporate and university audiences, and writes frequently on computer topics". Still he failed to mention function points (an old measure of product size) or use cases (a more modern measure of product size).

    He also fails to recognize that programming is a group activity, where one person can be seemingly unproductive, but in reality being vital for the productivity of the group. Typical such persons are mentors, which spends some of their time helping others. Mentors may not produce a single line of code, but still be the most valuable person in the group.

    Alistair Cockburn does in his modern classic "Agile Software Development" state that software development is a "Cooperative Game of Invention and Communication". Therefore the productivity is best measured at the team level, since they are, in the end, cooperating.

    Also, I think it is quite clear that use cases, or user stories, or whatever you wish to call them, are the best way to describe the wishes of the customer. Fulfilling these wishes are ultimately the only thing that matters.

    So, I would say that the number of finished use cases per unit of time, for the whole team, is by far the most meaningful measure of productivity.

    Mats

  160. Understanding what you're doing? by wide_awake · · Score: 2, Insightful
    How 'bout this as a metric:

    being able to answer the question
    "what are you doing to solve the problem?"

    If you know, big picture, what your plan is, but you've spent 2 days figuring it out, that's probably better than just jumping in and writing a bunch of crap just for the sake of writing it. You're less likely to have to re-write that way.

    In this case, you're probably going to write less code overall, but that's cool. This is a combo of Danny & Ingrid.

    The problem is, you can't keep too many Ingrids around, because what if the required feature isn't already available? Then you have a staff of people who just laze around hoping an easier solution will manifest itself. It's all about balance.

    Knowing how to proceed in solving the problem is a useful metric in an unfinished software product.

  161. Babies and code by Mr.+Fred+Smoothie · · Score: 2
    you can not get a baby in a month by making 9 women pregnant. Please repeat until you UNDERSTAND that, not just repeats it.
    Problem is, most program managers do understand it. But when they try to explain this to *their* boss, the likely answer is "Well, Bob, that's your problem. We promised customer X that they'd have it by Y. So you'll just have to find a way."
    --

  162. Creativity Requirements... by soup · · Score: 2, Insightful
    Who was more productive on this day? Certainly Ingrid. Fred and Danny are not even finished creating their features yet. Ingrid's feature works completely, she has simplified the entire program, and the user interface is improved by reducing the apparent feature count. But note Ingrid's productivity included writing negative 2000 lines of code and spending little time in the office. While this example may seem fanciful, it is actually quite realistic. Getting away from a problem sometimes is a good way to solve it. And programmers who understand the big picture make smarter decisions, because they are able to reuse code and combine features effectively.
    The process of software development is still a creative task, requiring the exercise of human imagination and judgement.

    Few can properly measure the output of a programmer except in Yhellowstones (brown fluid in --> yellow fluid out) since this will remain a judgement call until this becomes a determinant rather than an emergent process.

    A poet is still working even when gazing out the window.

    Finally, usually communications/research time cuts down on code generation- and that's the real question. How can we have metrics unless there's a second opinion over whether code needs to be created?

    --
    -soup (GNUrd, Speaker to Machines) "Laugh at yourself- Why should everyone else have all the fun?" -Romanchek's 6th Ru
  163. Problem w/ design docs by Mr.+Fred+Smoothie · · Score: 4, Insightful
    The problem with "proper design docs" is that time spent writing them and keeping them up to date in the face of constant requirements change is time not spent actually writing software and keeping it up to date in the face of constant requirements change.

    You should strive to make your design docs just good enough for the people who'll be reading them -- the maintenance programmers, who will also have the code. In other words, the design docs are the cliffnotes to the code. The code is always the authoritative design documentation.

    BTW, I STRONGLY recommend reading Agile Software Development for anyone who's seriously interested in these issues.

    --

  164. Miscommunication by seangw · · Score: 2, Interesting

    Why would someone want to know "How many lines of code per day do you write?", or "How many good lines of code do you write?". The problem here isn't in the programmer being unable to be clocked, but not hiring proper management. If I am programming something, I don't want to report to someone who doesn't know what I'm doing, I want to be able to explain to him reasons for things, and him be able to understand it.

    The issue arrises when an individual has to report to someone who just wants a number, and doesn't trust an individual. If upper management were to hire a manager that has proven performance, he should be trusted to say that "Coding is going along well, we have completed [fill_in_blank], and are well on our way to [fill_in_blank].".

    Programmers can then show what they have done, and prove why it was done the way it was, and the closest management can understand. That management should also be educated or trained in communication between code, and his management (aka, his job).

    We shouldn't have to say how many "pixels we painted", or "lines of code", or "notes played today".

  165. Self-documenting code is a pernicious myth. by Ungrounded+Lightning · · Score: 2

    In summary, the code can and show be written so that most of it documents itself.

    Please excuse me for taking that line out of context. But it is important.

    Regardless of the clarity of the code or lack therof, you need the comments - or another expression of the code's intent - to verify that it is doing what was intended.

    "Self-documenting code" cannot be tested. This is because testing cannot determine if a program works, only that what it does matches what another document says it should do. The best automobile engine control program won't balance your checkbook, and vice-versa.

    Once the comments (or other documents) are written, readable code is better than unreadable code. But if the only description of what the code should do is the code itself, the only thing you can test is the compiler.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:Self-documenting code is a pernicious myth. by kevin42 · · Score: 3, Insightful

      Sorry, but that's utter crap. Simple code is every bit as straight forward as comments in english.

      You claim that code cannot be tested unless it's documented. Then how do you test the comment that is supposed to be describing the code? It's just as likely to be wrong as the code is itself. Example:

      // This code prints foo to the console
      printf("bar");

      Why should the comment be the true authority? It's no more an authority than the code. I've seen countless examples of the comments being far out of date compared to the code.

      The point is that simple code *is* obvious and doesn't need any further comments.

      I wasn't talking about the design document, I was talking about the inline documentation, aka comments. I think all code should be designed before it's built and that design should take the form of a document, but that is not the same discussion we were having.

    2. Re:Self-documenting code is a pernicious myth. by The+Cookie+Monster · · Score: 1
      simple code is obvious and you can read what it does, you can't however read from the code why the code was put there in the first place - why it doing things the way it is, what the intent behind the code is etc.

      eg:
      ShowMessageExclamation('You can't currently do this because...');
      PostMessage(historyEraseCheckBox.Handle, WM_LBUTTONUP, X, Y);
      Perfectly readable - it brings up a message to the user then posts a WM_LBUTTONUP to the historyErase tick box.

      WTF does it post that WM_LBUTTONUP?

      With comments your attention would be drawn to the fact that that that piece of code gets called from within a historyErase click, tick boxes fire their click events on a mousedown, you have just changed focus after the mousedown event but before the mouse button is released (by bringing up a message box on the mouseDown), and so the check box will never get a mouse up and end up in the wrong state until clicked on again.

      There are other ways to do this, but then (without comments) you'd be left wondering why the code didn't just call ShowMessageExclamation() in the onClick event.

      I was going to say that only trivial code doesn't need comments, but even the example I gave is trivial.
    3. Re:Self-documenting code is a pernicious myth. by Fjord · · Score: 1

      In addition to the other poster's comments, I'll add that code can document code. This is one of the important reasons to have automated unit testing. The unit tests test the code and are code.

      Like the other poster said, the unit tests are not to be considered the authority. The authority only comes from the actual vs expected outcome of the program code. A unit test can be incorrect, as can documentation. There has to be intelligence involved in determining what is right and when is wrong.

      --
      -no broken link
  166. it's called Software Quality Metrics by beanerspace · · Score: 3, Informative

    A quick trip to the IEEE's online store, and about $300 bucks will give you all the gory details you need to measure software quality ... provided you consider that software quality synonyous with programmer productivity.

    For example. In grad school, we took the 1992, IEEE Standard for a Software Quality Metrics Methodology, along with GNU Flex, and wrote a program that would slice-n-dice C & C++ programs against a table of measureable metrics for code readability and reusability.

    Of course, we had a blast testing it against winning entries from the 9th International Obfuscated C Code Contest. But we also noticed that there were just some things that it would never be able to test. For exmaple, while our little app spotted code that was uncommented, it could not tell us whether or not the comments were useful or relevant.

    Point is, judging code and productivity is always (or at least until HR offices are equipped with Beowulf's) going to have a subjective element. Because lets' face it, when it comes down to it, many bosses really only care that the job gets done on-time and under-budget.

    Or what's that great line from the movie "War Games" ... Hell, I'd piss on a spark plug if I thought it'd help.

  167. Your Peers and your intuition by rlsnyder · · Score: 2, Insightful
    ... are the two things I've personally found most reasonable when trying to guage developer effectiveness. Having regular code reviews, in addition to a lot of other tangible benefits, exposes the quality of a developer's work to the rest of the team. Over time, the team will generate their own evaluation of each member.

    Using peer reviews and feedback, therefore, allows a manager to qualify a particular developer's "productivity" by asking the only metric worth anything - the opinion of other knowledgeable developers. Trying to equate any of this to any metric so far uncovered is truly pointless.

    Not that there may not be a real metric (or, more likely, a complex set of metrics) out there that someone will discover to adequately measure this stuff; in the meantime, though, I'll continue to let the team examine, develop, grow, and rate itself. In the end, I know I'll have a strong group of developers who respect each other, work well together, can understand each other's code and approach, and who are...productive.

  168. Straw dummy by Anonymous Coward · · Score: 0
    This is potentially utter rot. If you make something "compact" then you're quite likely *using* the language to insert every idiom you can think of. That makes code *unreadable*, not productive at all.
    What is utter rot is the assumption that making things compact equates to the use of obscure idioms. The fact is that most of the bad code that I've seen can be made not only shorter but also more readable, even without using any additional language elements. The usual reason for code to be bloated is that the author hasn't analyzed his task adequately before starting to code.

    For that matter, the use of an obscure idiom can be readable if you take care to document properly.

  169. Lines of code doesn't measure AMOUNT of code by DunbarTheInept · · Score: 2
    On a somewhat related note, I utterly hate the "lines of code" metric as a means of measuring amount of code. Okay, given all the article says about the uselessness of measuring amount of code, occasionally it's still a handy thing to know, like if you want a measure of how long a piece of code is, or perhaps you are trying to strip things down into a simpler form and you'd like to know how much code you actually reduced.

    At any rate, once you are in a situation where you want to measure amount of code, USE NUMBER OF TOKENS, not number of lines. (The number of words returned by a dumb word counter tool like the unix "wc" command is probably a good enough approximation to number of syntactical tokens.) Counting lines is useless in any of the modern languages where all whitespace is treated the same way regardless of whether it's space, tab, or end-of-line. Consider the degenerate cases:
    //lots of lines
    printf
    (
    "the number is %d\n"
    ,
    foo
    )
    ;
    // versus just one line:
    printf( "the number is %d\n", foo );

    If you are trying to reduce complexity, reducing lines of code might not really be doing that - it might just be writing the same amount of code with more obfuscation, giving the opposite of the intended simplifying effect. Counting the number of tokens, or words, would be MUCH better.

    Counting lines of code is a leftover from the days when languages were "dumber" and did things like require exact columns in the source code, and not let you throw in whitespace where you like.

    --

    Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

  170. Good management by Anonymous Coward · · Score: 0

    1. Have strict coding/testing standards.
    2. Have a smart developer assign roughly equivalent (in terms of difficulty) use cases to the other developers.
    3. Productivity is measured by number of cases completed through system with zero defects adjusted by their difficulty coefficient.

    You can't let the folks whose productivity is being analysed control the analysis metric. You need to have work assigned by a knowledgable person. Pointy haired bosses need to be insulated from the actual code writers by at least one level of technical task leads.

  171. Structured OOP by Anonymous Coward · · Score: 0

    When I worked doing barrels of C++ a day we had a program model tat we actually drew (one we came up with ourselves) We kept track of how complete each part of the program was by filling up that part's symbol with pen. the Managers liked that.

  172. Re:Tony Hoare -- ANSWER by Yankovic · · Score: 2, Informative

    Though a bit off topic, here's a very good explanation behind this code:

    http://research.microsoft.com/~tball/papers/Xmas Gi ft/

  173. But pascal isn't such a language by DunbarTheInept · · Score: 2
    But the irony is that Pascal, the language, is an excellent excercise in unnecessary verbosity. When you combine strong typing with a lack of any way to make a 'type-agnostic' routine, you end up having to verbosely re-code the same damn algorithms over and over and over. Here's the version of my sort that sorts strings - heres the version that sorts integers - here's the version that sorts floating point numbers - here's the version that sorts employee records.... here's the binary tree routines for storing employee records, there's the ones for storing customer records, etc, etc, etc.

    Ugh.

    Niklaus Wirth invented a language esteemed by acedemic professors, but not terribly useful in actual practice. I find it quite appropriate that he named it after the man who came up with Pascal's Wager - an argument for beliving in god that was hailed by the people who already believe in god, but utterly useless in practical application to its intended audience, those who don't.

    --

    Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    1. Re:But pascal isn't such a language by Anonymous Coward · · Score: 0

      Modern Pascals have the advantages of Pascal without those problems you mentioned.

      However this doesn't contradict your point.

      (Hey, you knew *somebody* was going to point this out when you wrote that ;))

    2. Re:But pascal isn't such a language by DunbarTheInept · · Score: 2
      I am of the camp that says the definition of the language is a thing independant of the implementation of the language. ISO C is still the same ISO C regardless of whether you compile it with gcc or cc or turbo C, or...

      The fact that some have chosen to fix Pascal's built-in language limitations by altering the language itself means that the language they are now compiling is something other than Pascal, that just kinda looks similar to it.

      No, this isn't a bad thing, but it's also not entirely true to be calling it "Pascal" anymore.

      Modula-2, for example, is Pascal-like, but with some of the problems fixed, and it got a totally new name because of it.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

  174. Similar experiences right now... by spectecjr · · Score: 4, Interesting

    The firm I'm working for hired a contractor to write the system software for their scientific instrument.

    They later hired me.

    It is now my job to maintain, expand and rewrite his original code as the device gets further from the prototyping stage.

    Here's some metrics for you:

    4000 lines of C code

    Avg. Variable name length: 3 to 4 characters

    Avg. Function Name Length: 3 to 4 characters

    Total number of functions (not including state-machine functions): 9

    Amount of documentation: nearly 0. Comments are laughable.

    Total number of functions, including state-machine functions labelled from stsws0 through stsws30 - 40.

    Total number of constant values used without #defines or assigned names: Too many to count.

    Amount of documentation of constant values that aren't obviously for buffer/scratch space, but actually do something important: Zero.

    Amount of dead code: Current investigation indicates somewhere between 30% and 60%.

    Amount of dead code interspered with live code, so it's really difficult to work out what's a dead function, and what's live: All of it.

    Level of interweaving of dead code and live code: pretty damn high.

    Use of pound-defines for code switching and giving alternate code paths: Zero.

    Use of pound-defines to switch blocks on and off that really you want to keep on ALL THE TIME (particularly as the app crashes if you turn them off): 10

    Interesting idioms:
    -- Use of pound-if(0) and pound-endif to bracket (useless) comment sections, eg:
    pound-if(0)
    This is a comment.
    pound-endif

    -- Use of a while loop to do error handling. Eg;

    while (TRUE) {
    if (condition) { error = 5; break; }
    ... other conditional code
    break; // to exit
    }

    if (error) ...

    Number of pound-includes that are actually totally unneeded:
    5.

    Number of Windows 3.1 programming idioms used: 2 found so far. In a piece of code that *requires* NT4 and as such is Win32 only.

    Other interesting idioms: Massively nested if's EVERYWHERE. Very little modularisation. Grabbing an HDC at that start of the app and not letting it go until shutdown, without specifying a Class DC.

    The guy REWROTE FROM SCRATCH button controls and edit controls, using WM_MOUSExxx message and WM_CHAR handling, as part of the main frame window. Each edit/button has a separate cut/paste if statement block to handle it. There are about 80 controls on the main screen. This code is cut and pasted for each single control.

    And for the final piéce de resistance;

    Total number of local variables used: ZERO. 0. Nada. Zilch. EVERYTHING IS A GLOBAL VARIABLE.

    --
    Coming soon - pyrogyra
    1. Re:Similar experiences right now... by Anonymous Coward · · Score: 0

      Thank you for finally finding someone who is worse than my coworker!!!! Yeah!!!

    2. Re:Similar experiences right now... by RogerWilco · · Score: 1

      Auch!

      you deleted the files and started from scratch?

      --
      RogerWilco the Adventurous Janitor
    3. Re:Similar experiences right now... by spectecjr · · Score: 1

      Not yet. First I have to understand what it does.

      The amazing thing is... the code actually works!

      But yes, rebooting the development process is phase II :) Ultimately, all this code is only for our prototype system anyway (the production system has a completely different architecture, processor, et al), so it's not that big a deal.

      --
      Coming soon - pyrogyra
    4. Re:Similar experiences right now... by bigsteve@dstc · · Score: 1
      Two pieces of advice (or the same advice twice):
      • Don't be afraid to throw away prototype code and start from scratch.
      • Don't be afraid to throw away unmaintainable code and start again from scratch.

      I'm not saying that you should always do this, but in many cases the long term outcome is much better if you can get rid of the crap.
  175. Pure Programmer Productivity by Anonymous Coward · · Score: 0

    "Time Solution used without modification" / "Time to deliver solution" is the ultimate productivity measurement.

  176. 10 lines per day?? by xtremex · · Score: 2

    I've had about 2 good programemrs tell me the "avg" programmer writes about 10 lines per day, the rest of the figuring out algorithms are looking up APIs...is this true? Or should a "good" programmer just know how to write all these functions?

    --
    If you're not a Liberal in your 20's, then you have no heart.If you're still a Liberal in your 30's you have no brain.
    1. Re:10 lines per day?? by Anonymous Coward · · Score: 2, Insightful

      I suppose there are rare disciplines where this would be an acceptable level. As much as measuring the lines of code for productivity is misleading and inaccurate, in some situations it could point out extremely low or extremely high productivity.

      If the programmers are engaged in testing, debugging, or optimization, ten lines of code per day *might* be acceptable. If they're in the design stage, don't expect any lines of code. Ideally, not a single line would be written until the full design spec has been laid out and approved by management or the customer.

      However, if they are in the middle of development, ten lines of code per day is abyssmal in virtually every case I can imagine. As an example, say you have a small application that consists of 100,000 lines of code (measured by however your programmers are defining a line of code). 100,000 lines of code is not a very large package (consider that W2K is, I believe, on the order of tens of millions of lines). It would take your two programmers at 10 lines/day 1,000 weeks (19 years) to complete the software. That assumes they work 5 days a week without ever taking a single weekday off for holidays, sick leave, etc.

      I'm a programmer -- in fact the only one for the division of the company in which I work -- and the software that I wrote from scratch beginning last fall consists of over 60,000 lines of code. It worked out to an average of 500 lines of code per day. A lot of the time up front was spent solely on design without a single line of code being written, so in reality that number is actually a bit higher when you count only those days where development work occurred.

      And I think I was slow. Either the two programmers who told you that 10 lines per day is the average were joking with you, or they're pitifully lazy. Or they're just not very good. But, before you get mad at them, take in to consideration that maybe there are outside factors that cause considerable drain on their productivity. Maybe they have extremely poor documentation to work with or they processes they're using for development are inefficient.

      The algorithm part can go two ways. Ideally, they should have included that in the design phase. They should have already mapped out the operation of the system -- unless the specs changed on them in a significant way as to thwart previous designs. It is also unavoidable in large, complex systems that issues will come up during development that cause the programmers to have to step back and think through things first. This can cause temporary lags in development as the design catches up to changes in the spec or unforeseen problems (maybe a piece of the core was relying on something promised from another vendor, but that vendor has disappeared). But if your programmers are constantly designing each little piece of the software as they reach it, without having mapped out the big picture, they're not very good.

      As for the API, that could either be extremely poor documentation (which in most cases can be remedied by dropping by a local technical bookstore) or programmer laziness. It is a poor approach to only look up those specific API calls as you need them without having any understanding of the entire package you're using. Each time a new external package is needed and its API will be used, the programmers should be learning that package as a whole before they begin to use it. They may get the software to work without it, but theyw ill lack the understanding of it to be able to use it efficiently, and many times correctly. For tiny packages you can get by easier, but when you start talking about using stuff like, say, Xlib directly you're making a big mistake to not learn as much of Xlib as you can before actually using it.

      Long story short: 10 lines per day is pathetic in most cases where development is fully underway -- unless significant roadblocks have been created that work against the programmers. But, expect very few lines of code during design. In fact, encourage it. You want your programmers designing the software, not rushing head first in to the development without creating a map. And if you go through extensive testing and there are very few lines of code being written or modified, that's probably a good thing because it usually means that there's not much to fix.

    2. Re:10 lines per day?? by tjb · · Score: 1

      I work on DSPs, and I write maybe 10 lines of production code per *week*, if you were to average it out. Sometimes more, usually less.

      Now, I do write lots of test code to find bugs. Debugging communication DSPs is a friggin nightmare: there is little visibility except for ram/register dumps and you can't single-step (for a variety of reasons, but namely the reality of sampling in real-time). So I write a lot of code to trap bugs and test hare-brained hacks to get around chip problems. But that's not production.

      I've spent weeks on a problem only to solve it by inserting a single nop :)

      Tim

    3. Re:10 lines per day?? by xtremex · · Score: 2

      Well, thse 2 guys were designing a PDA messaging system from scratch. The manager knew not a damn thing, and was expecting unrealistic goals. They had to design their own APIs for certain things. The one guy told me he spent the day researching API's and contemplating HOW to make it happen. Searching deja for similar problems solved, etc. This was all from scratch and they had nothing to go on. The main guy, who has been programming Java for 4 years or so, just didnt know HOW to do certain things, so he had to look them up, or spend an entire day figuring out HOW to make it work. I program, but not for a living. For example, I have NO idea how they wrote what they did. I'd have to spend months on researching the protocols. Like "How do I make a PDA send a signal to an stand alone speaker? They had to research electronics and hardware level stuff. To me, thats not programming. True, they shoudl have had this stuff laid out for them prior to the project, but they didn't PICK the project. One guy told me he was lucky if he wrote a line that was used for about a month. He was CONSTANTLY worried if his productivity was down because he had no clue what the acceptable level of productivity was. Could I rewrite apache from scratch? I don't know. I couldnt even tell you where I would begin. My programming knowledge consists of thngs that I know how to do. Could I make photoshop? Wouldnt even know where to start. Thats why I've never programmed for a living. How do you code something if you don't know how to do it? Where do you start?

      --
      If you're not a Liberal in your 20's, then you have no heart.If you're still a Liberal in your 30's you have no brain.
  177. Offtopic: One example by The+Cookie+Monster · · Score: 1

    Radix(??) sort the first array into a hash table, then go through the second array and look up the hash of each element to see what elements of the first array it might match.

    O(n) if your hash table is big enough that you won't get any double ups (assuming array values are unique), but still very fast if a table that big isn't possible.

    While I have to grant that the guy made his point nicely, I must complain bitterly that he's seeded my brain with this question - now I want to know what the fastest algorithm would be, and I don't even have an application for it.

  178. Easy to see you've never painted by endoboy · · Score: 1
    "but it's easy to look at a painting or a statue that's in progress and see work being done"

    This is just as much nonsense about art as lines per day is a ridiculous metric for code. The issue isn't how much, it's how much that's GOOD.... Why is it that all forms of endeavor that don't involve writing code get no respect on /. ?

    For that matter, your insights about management aren't much better--consider that managers might want progress reports to reduce the risk of the project failing, not to reduce the risk of getting fired WHEN the project fails.... Not every manager is pointy-headed, and not every code-jockey is a genius.......

    1. Re:Easy to see you've never painted by Anonymous Coward · · Score: 0

      This is true, but we're not complaining about the non pointy haired bosses now, are we?

  179. Productive Reading of the Article by nickynicky9doors · · Score: 2

    "If a programmer can be highly productive by writing a negative amount of code, how do we measure productivity for software engineers? There is no easy answer to this question..."

    The above is the article in a nutshell. Nothing to see here. Go back to work where the true measure of productivity is your paycheck. If money is an unfulfilling measure of your true worth then go out and buy yourself a cool new toy. It works for me.

    --

    heuristic algorithm seeks stochastic relationship
  180. Interesting LOC Numbers by Anonymous Coward · · Score: 0

    I work in an eBusiness sweatshop with entirely too much focus on VB COM. For fun a couple of months ago (when .Net hype hit), I re-wrote some of my code in Python, and then again in C#...

    For 200 lines of VB6, I used
    - 120 lines of C# (mostly legible) or
    - 80 lines of Python (which was 100% legible)

    http://slashdot.org/article.pl?sid=01/05/01/1539 23 9&mode=thread -- the more powerful the language, the less time should be spent writing it.

  181. Perfection in design... by gidds · · Score: 1
    ...is achieved not when there is nothing more to add, but rather when there is nothing more to take away.

    — Antoine de Saint-Exupéry

    --

    Ceterum censeo subscriptionem esse delendam.

  182. Unfortunately.. by Axe · · Score: 1
    ..it is hard to make a dichotomy of works/doesn't for any complex project. Remember all this Severity 1/2/3/4 bugs? "It's a feature, not a bug"? Convoluted and misunderstood requirements? Customers, who do not know what the heck do they actually want.. tech writers guessing how it should be..

    Anything, exept for "Hello, world" falls into the grey area of "kinda works, but we are not sure if that's what you need" or "works on my machine.." It would have been easier to have it "Good/Bad"...

    --
    <^>_<(ô ô)>_<^>
  183. Productivity is another way to spell politics by dgroskind · · Score: 2

    Before asking how to measure programmer productivity, or anybody's productivity for that matter, one must ask who wants to measure it.

    Programmers who are concerned about their own productivity usually take what measures they can to increase it. Managers, however, have their own political agendas that rarely have anything to do with a programmer's idea of productivity.

    Whatever standard of productivity a company adopts, it will be changed when business conditions or company politics change. For instance, even in a well run department a new manager will come in with a mandate to cut costs and boost productivity. Or, a bad manager will cover for his demoralized staff to protect his own turf. Or he'll fire a few programmers to please his superiors.

    I was recently standing in line at the food court and heard a woman behind me say to her friend: "They just hired 11 new programmers to replace the 5 good ones they laid off last year."

  184. Length of Variables Irrelavent by BlueFrog · · Score: 1
    Funny you should mention length of variables. I've never understood why anyone with A) decent typing skills and B) a real text editor would give a rat's ass about how long a variable name is.

    Once I've typed ISDN_Terminals_Per_Trunk once, I can probably just type ISD M-/ and be done with it. Are typical software development tools so unforgivably lame that they lack something like emacs's dabbrev-expand?

    Maybe my standards are misguided, but I've always considered this a basic function of a decent editor.

    1. Re:Length of Variables Irrelavent by Dominic_Mazzoni · · Score: 2, Informative

      Hooray for dabbrev-expand!!!

      If there are any emacs users reading this who don't know what dabbrev-expand is, try it now. It works like magic!

  185. Lines of code... by Anonymous Coward · · Score: 0

    How true could be to say that we (programmers) write deterministic code through a non-deterministic process (in some degree...)?

  186. non-deterministic process? by Anonymous Coward · · Score: 0

    How true would be to say that programmers write deterministic process through a non-deterministic process (to some degree... )??? ~~!@#(*$(???

  187. Utility versus Satisfaction by nickynicky9doors · · Score: 3, Insightful

    Definition:Productivity, '2 a : the act or process of producing b : the creation of utility; especially : the making of goods available for use.' from Mariam Webster

    Premise: Productivity cannot be measured except by creation of utility. Utility can be defined as a marginal increment of value. Value can be defined as a unit of production. Productivity then is a measure of increased value. Definitions of value have been attempted from Aristotle onward with varying degrees of acceptance. For business purposes value is found in the bottom line and is predicated upon Generally Accepted Accounting Practices.

    If we put aside the idea of a programmer being made to be 'highly' productive as a pipe dream then increments of utility can be put forth as the only available measure of productivity. For example I find I'm more likely to be 'highly' productive the more people like me, do what I want them to do and give me what I want.

    If we accept increased utility as a definition of productivity then the final product as it is defined becomes the final abitrator of value. This implies a Goal oriented approach to value based upon measurable increments to utility. This suggests any one programmer is capable of productivity only in so far as s/he is capable of adding to utility.

    If this simple definition of productivity is looked at from the view point of Open Source an interesting phenomenon arises in terms of the artistry of programmers. The Renaissance and post Renaissance periods produced leaps in Science and the Arts something akin to what we're presently experience. It's been suggested the creation of perspective drawings birthed the industrial revolution by providing schematics that made possible the production of the machinery of industrialization. A critical aspect of the Renaissance and the eras that followed upon it allowed for the free borrowings from the works of others. Those given to 'copyrighting' their material had little recourse, famed lutanists would hide behind curtains so no one could steal their chops. Bach, Shakespeare and others freely borrowed lines and more from their contemporaries and those who came before them. Bringing this rant to a close it remains to postulate whether the Open Source movement, in multipart harmony, provides a more efficient model for productivity? Well doh!

    --

    heuristic algorithm seeks stochastic relationship
  188. Productivity? by constantnormal · · Score: 1

    The first thing that immediately springs to mind is -- Exactly how many hours did Ingrid bill the day she was so supposedly "productive"?

    And the other thing that springs to mind is that her supposed "productivity" was clearly a factor of long experience with the system, and the wit to recognize the similarity of function that led her to the solution.

    In the Real World of plug 'n play coders, where no system is worked with for more than a year, system documentation is an obsolete notion (nobody is willing to pay to maintain it), and the concept of spending time to understand the system from the "Big Picture" down to the details is a fantasy, these things just never happen.

    "Productivity", indeed!

  189. Why does a woman always win? by Anonymous Coward · · Score: 0

    Why is it that in all these examples, the woman is the one who has the right ideas?

    Very similar to commercials were the woman always knows better, has the better deodorant, better car, better detergent, etc.

    Blah!

  190. Simple Is Beautiful by Taco+Cowboy · · Score: 1



    Sometimes I wonder if we have forgotten the true value of "simple is beautiful".

    Why make the art of programming such a complex issue?

    My personal style of programming is that I break the program down into really small, and really simple parts.

    If people think that my approach leads to bloatware, think again.

    If you break down your code into small and simple parts, MANY OF THOSE PARTS CAN BE RE-USE !

    That is, you don't need to re-invent the wheel.

    A no-brainer example:

    Let's say, in one part of your program you need to add two numbers. In another part you need to add up three numbers.

    You can create two different functions -
    one to add two numbers,
    and the other one to add three.

    Or you can create one function that adds up two numbers,
    and then REUSE that function to add up the additional number.

    I know the above example is a no-brainer. But by applying the same principle, and RE-USE the code, you may find that your program becomes MORE efficient.

    On another note, can anyone recommend any good book on writing beautiful codes? How about those "tricks and tips" books? Care to share the ones which deserve your recommendation?

    --
    Muchas Gracias, Señor Edward Snowden !
    1. Re:Simple Is Beautiful by Gromgull · · Score: 0

      And thats why LISP is the way forward.

      --
      -- .
  191. One solution to the SLOC / PHB problem by Anonymous Coward · · Score: 0

    Stop using line feeds.

  192. Progress Reporting by Anonymous Coward · · Score: 0
    I was asked several years ago to assist a branch office with a database conversion. The request came in a Friday with a six week lead time. "Sure no problem, but I'm starting 2 weeks vacataion."

    Came back to find out the PHB and counterpart had worked out a MSProject timeline and assorted smile-stones. Crossed off everything but "test data due" and "final conversion." Then set about doing it. Called and met with the end customer (how dare I ask the client what they want!) Got yelled at and yelled back. Spent 3 weeks populating a database (MS Access if you need to know) with all the details, reports to customer, exceptions and questions. Many conference calls with the the client.

    Not 1 line of code is written after 3 weeks. PHB knows I'll produce but counterpart is beginning to wig.

    Came in Friday, wrote VB against the spec database and generated 18,000 lines of code. Wrote 6 subroutines that code-gen routines needed. Wrote MAIN to call things and setup for I/O. Went to lunch and for a nice walk. Came back, submitted test data 2 days early.

    No feedback on test data, end client was happy. Tweaked for speed and ran conversion. No fixups.

    Progress reporting consisted of adding 5% (20 days) each day.

  193. Someone did by Anonymous Coward · · Score: 0

    It's called D

  194. What's really fun by wiredog · · Score: 2
    I'm looking through his code and I see one of the few comments.

    It reads: /* Why did I do this?*/

    Which did make it easy to find the bug I was hunting...

  195. Function Points by Anonymous Coward · · Score: 0

    Programs are made up of function points. Programmer productivity should be measured by FPs too. Some are a trivial "if", others are thousands of lines. The end user cares about function points. When I worked at NASA 12 years ago writing space shuttle software, we knew that FPs were it even though our contract required SLOCs.

  196. You have got to learn good programming practices! by red_gnom · · Score: 1
    Everybody knows that size DOES mater.

    I will give you a good advice: DO NOT, and I repeat DO NOT use loop statements. They are very bad. Instead use simple and tried copy and paste, paste, paste, paste, paste, paste, paste, paste. You will observe instant productivity boost. You will gain applause of your management, and maybe some day you will became one of them.

    Have a happy LOC programming.

  197. LOC also provide an indication of how bad code is by dwsauder · · Score: 1

    I recently downloaded an Open Source program, which I won't name, to evaluate. One of the authors (or maybe just a "promoter") had counted the lines of code, which came out to 96,000. The author then indicated how many developer years were required to write that many lines of code, using common estimating techniques. He was obviously quite proud of the fact that they had accomplished so much. As I noticed that the project had still not reached version 1.0, I just considered this to be an indication of how much time was required before they reached version 1.0, assuming that the code still contained very many bugs, and assuming that they weren't planning to add any additional lines of code.

  198. SLOC measures effort, not productivity. by dwheeler · · Score: 2, Insightful
    This article starts from a misunderstanding, and then "discovers" that the misunderstanding isn't true. Yes, source lines of code (SLOC) aren't good measures of productivity; that's because they weren't intended to measure productivity. SLOC are useful for estimating development effort. The best programmers manage to simplify problems so that they can solve the same problem with less effort. SLOC can then be used to estimate that effort, before it's expended, or used to estimate the effort that was expended. Claiming that SLOC measures productivity is silly.

    There's a whole literature on managing software projects. Look up terms like "Software Engineering" and "Software Management". For tracking progress, the usual approach is to divide the project into a series of steps, where each step can be unambiguously determined to be true or not (no "90% done" steps). Estimate the time that's required for each step and use a scheduling program to determine how long it will take; you'll also need separate management reserve time for the inevitable problems (but keep this separate from the steps, so that you'll know when you're using it up). Some people define dollar values for each step, resulting in earned value approaches.

    By the way, I've used SLOC to estimate the effort needed to develop one of the GNU/Linux distributions (Red Hat); you can see the results in More than a Gigabuck: Estimating GNU/Linux's Size .

    --
    - David A. Wheeler (see my Secure Programming HOWTO)
  199. Lines of code are not worthless by p3d0 · · Score: 2

    Lines of code are not a worthless metric, as is sometimes concluded from arguments such as those in the article. I do agree that LOC is questionable as a productivity metric. However, if LOC is considered a cost rather than an asset, then it is a much more useful metric.

    For instance, if two people solve the same problem, all else being equal, the one with fewer LOC is likely to be the one that was easier to write and to understand. Barring deliberate obfuscation, higher LOC correlates with complexity and complication. Fewer lines to write, read, and understand make a system more maintainable.

    It follows, of course, that LOC should not be a measure of productivity. That would be like judging a contractor based on how many dollars he spends per day.

    Of course, code terseness can be taken to extremes, but I think there's an 80-20 rule involved: you can trim the code by 80%, with proportional benefits in conciseness and simplicity, with only 20% of the drawbacks due to terseness and obfuscation. Code could (and should) be much smaller than it is today with no loss of clarity; on the contrary, the clarity would be improved by careful editing and refactoring.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  200. waxing philosophical by Tablizer · · Score: 1

    Much of writing software is like writing a user interface for programmers (other programmers or our future self). It can be a good interface or a poor interface. A good "programmer interface" will allow easy reading and changing without unforseen side-effects.

    Thus, judging software by lines-of-code is a lot like judging a user interface (non-programmer) by the number of screens and buttons. One should strive to be lean, mean, and clean.

  201. You are absolutely right... by Anonymous Coward · · Score: 0

    No, wait... didn't a famous mathematician hang out under an apple tree? Some guy named Newton. Invented a whole new branch of mathematics all by his lonesome called differential calculus.

    So, I guess you were wrong. I guess that's the way the apple falls. :)

  202. Re:You have got to learn good programming practice by Anonymous Coward · · Score: 0

    "yes, that's right boss. It's a new style called Inline Programming...apparently it's really hot in Europe at the moment..."

  203. Ingrid from Sweden ;-) by Anonymous Coward · · Score: 0

    I'm managing a software company and we have always been working the "Ingrid way", perhaps it is just a insight from the author to pick a swedish name as we actually do work in sweden!

    That more relaxed style is more common here, but no as common I would like it to be.

    But as long I will be in charge I will never forget my coding roots, I think I know how to create great code. You really have to create and environment where it is completely ok to hit the soffa and sleep for an hour if that seems like and good idea. One cannot force people to be smart and invent clever stuff...

  204. I guess I better repent... by danro · · Score: 1

    If a programmer goes to hell, that is probably the kind of code he will be forced to maintain for all eternity.

    --

    "First lesson," Jon said. "Stick them with the pointy end."
  205. Software is never complete by Beliskner · · Score: 1

    This is why commercial software is *NEVER* completed. Are there any commercial devlopers out there whose XP manager said, "Sure, refactor the code, take as long as you want"?

    Code refactoring (aka UnCut&UnPaste) is an often-skipped yet important development stage. Lines of code should go up during development, and then halted and refactored eliminating duplicate code *reducing* the number of lines of code, then at the end do a super refactor.

    My last project was feature complete at 1000 lines, after refactoring it became 400 lines, causing the code to become simple enough to spot a way to improve the algorithm from O(n) to O(nlog(n)), although we charge extra monnnai for the nlog(n) system. Luxuries like adding GUI and usability enhancements become much simpler after a big refactor. Without one you always get software bloat

    --
    A caveman dreams of being us, the incalculable power and riches. We dream of being Q, then what?
    1. Re:Software is never complete by Anonymous Coward · · Score: 0

      O(nlog(n)) is worse than O(n).

      I'd put those 400 lines back in if I was you.