Poal: cost at your company per line of code?

Your average cost (fully loaded resources+project costs) per line of debugged, PROD ready code?

  • under $10/line

    Votes: 0 0.0%
  • $10-15/line

    Votes: 0 0.0%
  • $15-20/line

    Votes: 0 0.0%
  • $20-30/line

    Votes: 0 0.0%
  • $30-50/line

    Votes: 0 0.0%
  • > $50/line

    Votes: 2 100.0%

  • Total voters
    2

glenn1

Lifer
Sep 6, 2000
25,383
1,013
126
Just curious what your average experience is. This is in part due to an executive seeming agitated that his "metrics" were being thrown off by someone writing efficient vs. spaghetti code and believing that someone producing 1000 lines of code vs. 10 to create the same solution was somehow "better" because on a 'per line basis' the first produces 'better' results based on his math (resource time consumed / lines of code produced). When someone pointed out the generic estimate I'd heard before for $12-45 per line of quality, debugged, PROD ready code he seemed absolutely gobsmacked. So just to make sure I'm not the crazy one, what are you guys out there seeing as typical costs? Presume a reasonable complexity business case with costs being estimated on a fully loaded basis for resources and no oddball expense drivers like needing a bunch of travel, etc.
 
Feb 25, 2011
16,994
1,622
126
Just curious what your average experience is. This is in part due to an executive seeming agitated that his "metrics" were being thrown off by someone writing efficient vs. spaghetti code and believing that someone producing 1000 lines of code vs. 10 to create the same solution was somehow "better" because on a 'per line basis' the first produces 'better' results based on his math (resource time consumed / lines of code produced). When someone pointed out the generic estimate I'd heard before for $12-45 per line of quality, debugged, PROD ready code he seemed absolutely gobsmacked. So just to make sure I'm not the crazy one, what are you guys out there seeing as typical costs? Presume a reasonable complexity business case with costs being estimated on a fully loaded basis for resources and no oddball expense drivers like needing a bunch of travel, etc.

Hard to say. I don't get financial data.

But I wanted to chime in about this:

believing that someone producing 1000 lines of code vs. 10 to create the same solution was somehow "better"

It's true that there are frequently better algorithms and better ways of doing something, But they are not always fewer lines of code. Yes, some people brain fart and do in 30 or 40 lines stuff that could be done in 20. But that doesn't matter - for every X lines of actual function code you write, you add about 5X lines of debugging, unit testing, error and exception handling, etc. It's all boiler plate, and not the "hard part" from an engineering perspective, but it's lines of code committed to source control. So in that sense, more code is probably better. If not better code, than it's better tested, better documented, etc.

There's also readability/maintainability and code style:

One line:
Code:
void main() { printf("Hello World!"); return 0; }

Several lines:
Code:
void main()
{
    printf("Hello World!");
    return 0;
}

Both compile, but one will get you a 'C' on your homework. Don't even get me started on four-spaces-versus-tabs.
 
  • Like
Reactions: Ns1 and NesuD

glenn1

Lifer
Sep 6, 2000
25,383
1,013
126
Hard to say. I don't get financial data.

But I wanted to chime in about this:



It's true that there are frequently better algorithms and better ways of doing something, But they are not always fewer lines of code. Yes, some people brain fart and do in 30 or 40 lines stuff that could be done in 20. But that doesn't matter - for every X lines of actual function code you write, you add about 5X lines of debugging, unit testing, error and exception handling, etc. It's all boiler plate, and not the "hard part" from an engineering perspective, but it's lines of code committed to source control. So in that sense, more code is probably better. If not better code, than it's better tested, better documented, etc.

There's also readability/maintainability and code style:

One line:
Code:
void main() { printf("Hello World!"); return 0; }

Several lines:
Code:
void main()
{
    printf("Hello World!");
    return 0;
}

Both compile, but one will get you a 'C' on your homework. Don't even get me started on four-spaces-versus-tabs.


Good response, I appreciate you taking the time to write it. And I realize it can be nuanced but this was more along the lines of "let's rate them based on this metric" which to me is kinda crazy since you're basically creating incentives to write poorly just to pad stats. Shakespeare wouldn't have written better plays if you paid him per word, it would have just been a longer play is the point I was trying to get across. Of course he really isn't getting other concepts like technical debt either so I'm trying to reframe this in a different way.
 

nakedfrog

No Lifer
Apr 3, 2001
63,014
19,306
136
I used to joke that a developer who (thankfully) is no longer with us must have thought they were getting paid per line.
 

purbeast0

No Lifer
Sep 13, 2001
53,664
6,547
126
No clue but more code !== better product. There is no correlation between lines of code and productivity. Your executive is a retard.
 
  • Like
Reactions: Ns1
Feb 25, 2011
16,994
1,622
126
Good response, I appreciate you taking the time to write it. And I realize it can be nuanced but this was more along the lines of "let's rate them based on this metric"

Well, kinda. Business management types working for tech companies often lack the technical background to really understand cause and effect. But they do generally have some capability w/ statistics and data analyses. If you look at the code bases of 100 products from 100 companies, and compare the lines of code to other metrics (average uptime, average downtime, customer satisfaction, dev/release cycle, money spent on sustaining and bugfixes vs. feature development, etc.) you'd probably find that many more mature, reliable, and capable products have much larger code bases. So I'd suspect there's a correlation.

But it's not that more code makes a better product, it's that a better product generally has more code.

which to me is kinda crazy since you're basically creating incentives to write poorly just to pad stats.

You seem to be concerned with the "holistic" management problem - if you focus on only one metric where you think you can control it, people will just game that metric. And yes, that's true - whether you're Microsoft or Walmart.

But writing bad code on purpose to pad line count? It's way less work to let your IDE auto-generate some unit tests, wrap everything in assert/except or try/except blocks, and then write your Twilight fan fiction in the comments. Who would go to the effort of doing that when you could just refactor that thing they wrote when they were drunk, commit a couple hundred lines of code they already understood, and clean up their mess before somebody in Q/A takes too close a look at it?

You're also ignoring other development "best practices" like doing code review. Who would do that and risk the wrath of their coworkers?

Shakespeare wouldn't have written better plays if you paid him per word, it would have just been a longer play is the point I was trying to get across.

He ran his own theater - so he actually did write his plays for paying audiences, with an eye to both audience tastes and putting on a show. The more plays he wrote, the more he could produce and the more money he made.

Most great art is/was created with an eye to the bottom line.

Of course he really isn't getting other concepts like technical debt either so I'm trying to reframe this in a different way.

A software dev manager really should understand technical debt - it's the Answer to the Ultimate Question of Life, the Universe, and Why The Hell Can't We Just Rewrite This Mess From Scratch!?
 

dullard

Elite Member
May 21, 2001
26,099
4,744
126
There's also readability/maintainability and code style:
People that I've worked with don't like it, but I find that I am far more efficient with my work if I use one line code judiciously.

I find this at the start of routines:
Code:
if (VariableToCheck == null) { return false; } // This routine requires the variable to be initialized

to be far more readable that what most programmers that I work with do:
Code:
// This routine requires the variable to be initialized
if (VariableToCheck == null)
{
     return false;
}

The one line check at the start of routines lets you get right into the meat of it. Whereas the multi-line disaster means you have to scroll for pages and pages just to see what is going on, especially if you have multiple checks.

But, if you are paid per line, I can see why you'd want to spend hours of each day just scrolling.
 
  • Like
Reactions: dave_the_nerd
Feb 25, 2011
16,994
1,622
126
to be far more readable that what most programmers that I work with do:

It's subjective. The majority usually wins. Too many people confuse it with an argument that really matters.

Here's a picture of me telling one of my coworkers that emacs is superior to vi:

article-0-15B6F0AC000005DC-901_634x373.jpg


But, if you are paid per line, I can see why you'd want to spend hours of each day just scrolling.

Is anybody actually paid per line?
 

Red Squirrel

No Lifer
May 24, 2003
70,722
13,851
126
www.anyf.ca
My company outsources to the same company that fubared up a certain US health care related website.

If I had to guess it's like $100+ per line of code. Just making a tiny change to a program usually costs in the order of 10 grand. Even if it's to fix a mistake that they made. Terrible company. Wish they would not outsource coding but seems most companies do it now. A lot of the stuff they've done I know I could do better and I'm not really a professional.

They recently changed the color of something in a program from green to red and it was like this huge deal lol. Would not surprise me if they spent 20 grand on that. Funny thing is, the program was coded by someone at the company but when it was found out that they coded it in house the outsourcer basically took it over and ruined it. There's something in that contract where we are not allowed to code anything in house, it has to be them.
 

dullard

Elite Member
May 21, 2001
26,099
4,744
126
It's subjective. The majority usually wins. Too many people confuse it with an argument that really matters.

Is anybody actually paid per line?
Yes, the majority usually wins. I just have a philosophy that if a routine requires scrolling to see all of it, then the routine is probably too complex. That isn't always an achievable goal as some tasks just are complex. But, wow, I waste a lot of time scrolling to try to interpret other people's code.

I don't know of people being paid per line. But, the OP is suggesting that their management might want to go down that route.