Posted by Uncle Bob on 02/01/2010
When it comes to software, you get what you pay for.
Have you ever stopped to wonder how much a line of code costs? It ought to be easy to figure out.
In the last 14 months, I have written about 20KSLOC in FitNesse. Of course that was part time. My real job is running Object Mentor, consulting, teaching, mentoring, writing, and a whole load of other things. Programming takes up perhaps 15% of my time.
On the other hand most programmers have lots of other things to do. They go to meetings, and then they go to more meetings. When they are done with those meetings, they go to meetings. And then there are the meetings to go to. Oh yeah, and then there’s all the fiddling around with time accounting tools, and horrific source code control systems that perform like a salamander crawling through frozen mud.
So, maybe 15% isn’t such a bad ratio.
The loaded rate (Salary plus everything else) for a typical programmer is on the order of $200K. (I know that sounds like a lot, but you can look it up.) So $200K / (20KSLOC / 14mo * 12mo) = $11.66/SLOC.
Let’s look at one of those lines: StringBuffer nameBuffer = new StringBuffer(); Does that look like $11.66 to you? Would you pay that much for it? Well, don’t answer yet, because for each StringBuffer line you buy, you get import java.lang.StringBuffer; absolutely free!
Some factories pay their employees a “piece rate”. Would you accept $11.66 per line of code instead of a salary? Of course it couldn’t just be any old line of code. It’d have to be tested!
Hey, I bet all programmers would do TDD if we paid them a piece rate!
The point of that silly analysis was to demonstrate that software is expensive. Even the dumbest little app will likely require more than 1,000 lines of code; and that means it could cost $12K to write!
Imagine that you aren’t a programmer, but you have a clever idea for a new website that’ll make you a zillion dollars. You’ve storyboarded it all out. You’ve worked out all the details. Now all you need is some high-school kid to zip out the code for you. Right? Hell, you could pay him minimum wage! The little twerp would be happy to get it!
That tragic comedy is altogether too common. Too many people have borrowed money against their father’s retirement account to fund a terrible implementation of a good idea. Appalled at how much the reputable firms charge per hour ($100 or more) they go looking for a cheap solution.
“After all, this software is simple.” Or so the reasoning goes. “It’s not like we’re trying to send a rocket to the moon or anything. And, besides, those expensive guys were just out to cheat us. Software just isn’t that hard to write.” Uh huh.
So the poor schmuck finds some freshman in college, or maybe a bored housewife who read a book on HTML last year and created a cute website to show off her kittens. Have these programmers heard about TDD? Have they heard about Design Patterns? Principles? How about source code control?
Clearly they haven’t. They’re going to sling a bunch of horrific code together, without any tests, versioning, or control. The project will start well, with exciting initial results. But then it will slowly grind to a halt, while the cash continues out the door unabated.
In the end the website isn’t going to get built (and the poor schmuck’s father won’t be retiring as soon as he thought). It will be a disaster that will either be terminated, or will require double or triple the investment to get right.
The bottom line is that, when it comes to software, you get what you pay for. If you want good software done well, then you are going to pay for it, and it will probably cost you $12/line or more. And, believe me, that’s the cheapest way to get your software done.
If you go out hunting for the cheap solution, then you’re going to end up paying more, and losing time. Software is one of those things that costs a fortune to write well, and double that to write poorly. If you go for cheap, you’re going to pay double; and maybe even triple.
Comments
Philip Schwarz 41 minutes later:
I wonder if we’ll ever see software developers providing their services on (the s/w equivalent of) a “No Win No Fee” basis.
Graham Brooks about 1 hour later:
And then when you have your web site up and running and it is ‘sort of working’ and ‘sort of earning’ the cost of doing a ‘proper job’ always out of reach…
Martin Vilcans about 1 hour later:
It’s not as simple as “you get what you pay for”. The expensive consultant may very well be a worse programmer (in the sense of writing working maintainable timely delivered code) than the cheap college kid. The consultant may be, and perhaps even is likely to be better, but you can’t be sure without checking them out further. And when chosing consultants, are you sure that the $200 one is twice as good as the $100 one?
Mark Nijhof about 1 hour later:
This is absolutely true, and often misunderstood indeed, you get what you pay for, and sometimes you need to build bad quality which imho is ok as long as the customer know that that is what he pays for. And I guess the most obvious reason for that is time to market and not getting something cheaper.
I like the two following posts as well that are in the same space.
http://jockeholm.wordpress.com/2010/01/29/programming-is-all-design/http://www.idapostle.com/design/why-design-cant-be-billed-by-the-hour/
-Mark
Pablo Fernandez about 1 hour later:
”...So the poor schmuck finds some freshman in college…”.
I think I heard a story like that once… The company was named 37signals and the freshman they’ve got from college was a guy that goes under the DHH nickname.
They kinda outsourced the crappy framework that they used but I think nobody cares about it…
Pablo Fernandez about 1 hour later:
Sorry. I tried to mean they ‘opensourced’ the framework.
And obviously I’m being sarcastic.
Philip Schwarz about 1 hour later:
Hi uncle Bob,
@DSpinellis recently tweeted: Dynamic languages make you program 5* faster, but also allow you to make a mess 5* faster. By @unclebobmartin #oop2010
Would you rather spend $12 ona a line of Groovy/Ruby or on 5 lines of Java/C#?
Marcelo Lopez about 2 hours later:
I hear you Martin, but it doesn’t always fly. Of course you have to “trust but verify”, but then again, enough business don’t and opt to go the “path of least resistance”, which to most businesses means the path of least cost. That creates a value impedance in the industry. And in the long run, ruins billables across the the board.
I’m not sold on that a $200 consultant is awfully better than an a $100 one. But even a $100 consultant has BEVY of competition, from all manner of places ( I don’t have to go into it, I’m sure we all have very good ideas where some of those places might be ).
Robby Russell about 7 hours later:
Philip, by what metrics would you propose that we use to determine if the s/w… wins?
BjartN about 12 hours later:
I agree on what you are saying. Code is expensive. However, in a start-up one thing is more important than clean code, and that is actually getting started with your project and actually creating the software. Sometimes you just want to duck-tape together a piece of s* and deploy it. Especially it the alternative is doing nothing. Analysis paralysis and things like that.
In the long run clean code is always a winner. No argue there.
GiantIsopod 1 day later:
Well, our school payed 10 000€ for their website, and even as a “cheap student”, I can tell it’s crap. That being said, it was outsourced to India. I’m sure a lot of students (including myself) would have done a much better job for like 10% of the money.
What you are saying may be right in most cases, but my point is that there are also a lot of dubious companies who take advantage of uninformed people and charge them prices that are way too high for the quality they get in the end.
Also, when you compare private/community projects with their commercial counterparts, the private projects are often superior, simply because their developers are more enthusiastic about their project.
John Sonmez 1 day later:
Great point! It is also one of the reasons when I hear companies will not pay to have their developers have dual monitors and the fastest computers and tools money can by, I just can’t understand it.
If it is $12 per line of code and you can buy a tools that make a developer even 10% faster…
Joshua Lewis 1 day later:
I agree in part and disagree in part.
Yes, it is cheaper to find some college grad to get the job done. Part of the reason its cheaper is the industry’s fault: there is no professional body overseeing competence in the industry. There is no equivalent of a medical board or legal bar to say ‘yes this person has completed the relevant training and apprenticeship and has been assessed as competent’.
I disagree in terms of return-on-investment. To me this is related to technical debt. Take the expedient route to make some money, and then use this money to fund the debt repayment (whether the debt is financial or technical). I do concede that this does imply some degree of competency on the part of the developer, but only in terms of getting something out the door.
I also know that as someone with a master’s degree in engineering and an idealist, I tend to overengineer any solution and am thus not the best person to get a new idea off the ground. This is where the principle of getting things out the door/deliver early deliver often provide a lot of value.
Jan Daniel Andersen 1 day later:
@BjartN. If the “duck-tape together a piece of s*” is based on a well-informed decision (ie. you know that at some point you will need to scrap it all and start from scratch), it might be a good idea, to reduce the focus on quality and clean code. But I haven’t seen a single example where this decision hasn’t backfired at a later point. There’s nothing more permanent, than a temporary fix/hack. This stuff tends to end up as the foundation of other and newer stuff. And that is where hell starts.
I’m pretty sure that Uncle Bob, isn’t advocating BDUF, so his ideas would probably never result in Analysis Paralysis.
Also I get the impression, that you mean to say, that relaxing the quality will actually make you go faster. My experience is the exact opposite. Even for smaller projects. “All” it requires is people skilled at doing great quality work. And those people tend to be more expensive, than your average “know-a-little-scripting” guys. But, backed up by real life experience, I totally agree with Bob, that high quality is the cheaper alternative.
Jan Daniel Andersen 1 day later:
@Joshua Lewis. Good quality is very much about not overengineering. Delivering exactly what the customer needs (not what you or he thinks is fancy) is absolutely within the quality concepts of agile methods.
Jeffrey Palermo 1 day later:
The high school student and html housewife are good examples, but (at least in my neck of the woods), I see the same results from people whose profession is programming. Some have computer-related degrees. The result is the same, as you’ve described. In Austin, the start-up company culture fosters it from the venture capitalists on down. Great idea, now GO GO GO! We’ll slide pizza under the door!
Then of course, they try to go fast without going well, and it ends up as you’ve described.
As an aside, my first VP-level position was with a start-up in 2006. I came in, put in place weekly iterations and lots of testing (fitnesse too at the time), and we went blazingly fast (because we also went well).
Andrea Maietta 3 days later:
@Unclebob very interesting post! I wish product owners understood your point…
@Joshua technical debt is an ugly beast, keep in mind that it tends to accumulate at a very fast pace. How much are you willing to invest before you decide it’s time to cancel the project? Keeping technical debt small does not necessarily mean BDUF (after all we’re talking about the simplest thing that could possibily work), so I think we should always strive to keep our code clean, not (only) because it’s more elegant, but because it’s cheaper (cheaper meaning less expensive, not of lower quality). Way cheaper.
@GiantIsopod Obviously, I have not seen the website, but don’t be too quick to say you’d do a better job for 10% of the cost. How much time do you think it would take you to do a similar website? Ok, double that figure. And, if you’re quite inexperienced (no offence intended, just as an example), double that again. And again (you’ve read the post). In the end you’ll find that you are working on a surprisingly low rate per hour… hey I’ve done it myself, luckily a long time ago (in a galaxy far far away)
Derek Smyth 3 days later:
amen to that Uncle Bob!! I am not alone!
the amount of times I’ve seen this in action. Dynamic languages, which are great, lend themselves nicely to this anti-development (?) practise.
“Hey coding is easy; everyone come look; see how easy it is. Why it sort of kind of works if I you just give it a little bit of… oh wait it worked a moment ago…. where’s Derek?’
500 lines of spaghetti that could of been written in 100 lines.
Of course static languages are just the same but there is a tiny little bump of learning needed first to get them, and the IDE, going. Just enough of a bump to put some people off.
You absolutely get what you pay for.
devMomentum 3 days later:
I think a big part of the problem why software is costly (besides bad requirements, bad management, ...) is that we are still writing way too much code. Yes there are libraries, frameworks, ... but we are so much writing the same kind of code over and over and over.
We know how to do that piece of code, but we forget to set a property here, Google to find why that javascript function does not work, build, execute, and start all over… Also, How many Products, Client, ... tables exist in all databases? We are still creating new ones for each project.
Software costs will go down the day we start building software and write application specific code only (if needed), and stop wasting time writing the same stupid code over and over. Writing code will be reserved for hard, unique and interesting problems.
Jan Daniel Andersen 4 days later:
@devMomentum. If you mean the actual typing of the code, I totally disagree with you. The time spend actually typing in the code should, for a skilled practitioner, be a lot less than the time spend thinking about how to write it (while writing it, no BDUF here!).
This is why pairprogramming isn’t a bad idea. You sacrifice some typing time (the smaller timesegment), while gaining some “thinking time” (the larger timesegment), due to synergy.
There are a lot of libraries out there that can solve common and wellknown problems. The code we write ourselves should be the code that we cannot get from elsewhere or where there is a clear and measurable value (customer value of course) in writing it.
devMomentum 4 days later:
@Jan Daniel Andersen. I don’t mean the time we actually type the code, I mean the time we spend thinking, designing, coding, fixing our mistakes, googling for help, ... for already solved problems, so should not require coding.
Yes there are lots of libraries, but we are nowhere near the kind of reuse we should already be able to do after all the code that’s been written.
Jan Daniel Andersen 7 days later:
@devMomentum. We could probably reuse more than we do, but since it’s not done, my guess is that it isn’t feasible.
Using third party components always come at a cost and it seems like this cost is too high at the moment. When get even more intelligent programming languages (higher level), it might become easier and we will see, reuse go up.
Terry D 10 days later:
Interesting article – I particularly like the meeting references in the intro – from the companies I have worked at that is oh so true, and we used to have meetings to arrange the next meetings! From my experience, even a large number of those that work in companies that have a software component (though aren’t specifically software houses) have no real concept of the cost (or perhaps the value?) of the software they are to have written. They are then surprised by the time it takes to do it right. I agree, you get what you are willing to pay for.
JPatrick 24 days later:
There is no doubt that in software, as with many areas of life, you do indeed get what you pay for. I also second some earlier commenters in that it is difficult to get people within the software industry to understand this, let alone those outside. This seems to be particularly true of middle-management withing software companies that have lost the grasp of what software development actually involves.