The Duct Tape Programmer
joelonsoftware.com
joelonsoftware.com
But I will not write trivial tests just to make the unit test coverage increase. I've seen tests written for simple getters/setters that just sets "this.birthday = date". If we do contact an alien civilization that have multiple birthdays, we will probably have to change the code anyway and the unit tests will have to be rewritten.
I may get some negative votes for saying this, but whenever I see a project with 100% unit coverage it's a red flag for me. This means they have wasted a lot of development time while writing trivial unit tests for trivial code.
Unit tests are great for parts of the code that needs them. But if your only reason for writing a unit test is to see the statistics "improve", you are wasting effort.
But there's a time and place for everything. I rarely pass 95% test coverage, the remaining 5% are usually not worth pursuing.
A better process is to write or purchase plug-ins for your SCM system that audit all commits and either notify of a contract violation or refuses commit without a supervisors override. Enforcing contracts is not the domain of custom code it is the domain of SCM and therefore should be implemented at an SCM level. This way you write it once and everyone benefits whereas with test you are a. writing test for every contract and b. leaving in the hands of the current developer to ensure the contract is met. Further by having it audited you can build a process around that audit to guarantee that the issue is accounted for.
I am not sold on TDD, but I have not thrown it out as snake-oil yet either. It is in no way the harbinger of quality it was heralded to be, but logically there are some places that it seems like it can and does help but my general feeling about it in the way that it is sold (test everything), is that it is a wast of time.
You set the code coverage bar high enough.
While I disagree with the said VP or Lead or Senior people, but sometime we have to admit that not many developers in our industry care about quality and have the attitude of test is important.
I get that shipping is more important than anything else. But I found people often use that excuse for not writing test. Besides... the definition of "Done" pre-TDD/Agile is "I wrote my code albeit not thoroughly tested, now let me throw this pile of crap over the wall to the QA".
It's just how our industry used to work until recently.
The challenge for a startup is finding the right balance between the two.
I ask you, in what other industry would doing shoddy workmanship be considered an insightful viewpoint? Would you be happy if you discovered you'd hired "The Duct Tape Plumber" to fix a leak in your house?
Furthermore, I've actually known real people like the ones Joel Spolsky idealizes: "He is the guy you want on your team building go-carts, because he has two favorite tools: duct tape and WD-40." Spolsky is wrong wrong wrong: you do NOT want this guy on your team. He's the guy who ruins bearings because he uses WD-40 instead of a real lubricant, the guy who spends 40 minutes crafting a duct tape solution rather than take a 20 minute drive to O'Reilly's to get the right part. I had a guy like this work on a truck I used to own; we accidently bought the wrong heater core but rather than get the right one, he figured out it could fit backwards if we cut the panels around it and routed the hoses around it in a loop, and then he covered it in duct tape. The problem is that it wasn't really air tight, so it was no good as a heater because it didn't force the air through. I had to redo it myself with the right part, and had to reattach all the panels he cut.
In many cases, he has valid opinions, but just like in medicine, more opinions should be sought before making a final decision.
Certainly we'd all be happy to have jwz onboard our teams, but Joel holds him out as the one exception of a "good" duct-tape programmer. It's just really absurd. Joel's position seems to be "anyone that does not follow the dictates of the latest MEGA XTREME WATERFALL AGILE METHODOLOGY is going to do more damage than good", when really, like in almost everything else, the passing fads are merely empty promises hyped on to make consultants and specialists rich.
You may want to read jwz's response, I think it is fairly concise and good: http://jwz.livejournal.com/1096593.html
So the problem was that you did not use enough duct tape.
What's the point of my story? Perhaps duct tape isn't always the best solution, but there are certainly times where the application of duct tape (or zip ties) is an appropriate response, the trick is identifying when and where, and being willing and able to do it when it makes sense.
A couple of obvious points have been made at the time. Yes, it's a gross generalization. Yes, somewhere in there is an uncomfortable truth that is liable to make a couple of Java and COM artists very angry.
At the end the whole point boils down to the overused saying: real programmers ship. It's as simple as that. All this artificial distinction between "Duct Tape Programmers" and whatnot is just an attempt to elaborate somewhat unsuccessfully on a central experience of software development.
This is why: Our code sucks, and there are many reasons for it. We may have some control over WHY our code will suck, but the core fact is just inescapable. Of course, there are people who claim their code is always beautiful (often paired with energetic statements about some framework technology) and it's worth noting that those developers are easily the worst of them all. At least the rest of us have some semblance of self-awareness.
If more programmers actually read stuff that was published longer than (gasp!) five years ago, perhaps there would be less naive noise about how New Methodology X is going to finally fix all these nagging issues in software development once and for all.
It makes sense when dealing with surface details in rapidly changing web APIs, but otherwise that approach condemns programmers to starting from zero and wasting time re-discovering fundamentals.
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." — Richard Hamming
While I've been programming since I was a kid, my academic background is in history - Viewing the industry through that lens reinforces how it's collectively in an early phase where people still fall to their deaths trying to fly with wings made of wax and feathers.
There have been plenty of people with real breakthroughs, but the average programmer probably hasn't even heard of them. I mean, their work is already obsolete, right?
Peter Seibel tried to "unpack some of the context," it's probably a good place to start for anyone who's interested:
http://gigamonkeys.wordpress.com/2009/09/28/a-tale-of-two-re...
If only wishing made it so!
He will research long and hard on the conditions in which programmers perform the best, then try to break programmers down to categories and figure out which one he fits into the best. Then he will research the psychological flow needed for programming and spend long hours planning out the IDEAL setting for the "flow to kick in". Then he will write a couple of articles on much flow rocks and how awesome it would be if everyone could achieve the perfect flow, and then go to sleep.
No actual programming (or even architecture astronautics) has been done during this process.
1. Make it work
2. Make it right
3. Make it fast
All Joel is saying is that If you're up against a time constraint (like trying to ship code) ... its okay not to get to 2 or 3 right then and there.
I think thats a good lesson for hackers to learn.
> Remember, before you freak out, that Zawinski was at Netscape when they were changing the world. They thought that they only had a few months before someone else came along and ate their lunch. A lot of important code is like that.
It makes sense that, under these circumstances, their #1 priority was to ship, to bring a product to market before others did. Even if the first version sucked, it would still be better than no product.
Unfortunately this is exactly the kind of situation that gave us IE, and we still have to deal with the after-effects today. I wonder if this would count as an argument against the often-touted claim that "competition makes products better". It sure didn't cause browsers to be better in the late 90s. In fact, we didn't start to see decent browsers until after the browser wars, after IE's dominance had been established.
We were a bootstrapped startup, and the need to use bleeding edge tech (our product was hardly rocket science) reinvent the wheel (hey, look at this - I spent a week and created my own grid control!) and a general need to overengineer seemed to blind the astronauts from the fact that if we didn't have anything to sell, we were going to run out of money in a matter of one or two months.
We were "using" agile, and the lead engineer's approach to test cases was "well, if the function failed the test, let's just change the test to make it pass". Sheesh.
Needless to say, the company struggled to meet payroll for an extended period time since we couldn't release anything to generate revenue.
when I was linked from my rss reader (just now-ish), it was set to go to: http://localhost/www.joelonsoftware.com/items/2009/09/23.htm...
should be: http://www.joelonsoftware.com/items/2009/09/23.html
thanks.
Of course there are rare cases that you need to trade size for speed. But it should be done with careful cosideration.
Edit: I forgot to add that I always thought that 'duct tape programming' means writing hacks to fix hacks - which is bad.
When you work in enterprise software, this approach might work on the first project, maybe the second, but eventually a point will arrive where a requirement will take longer to deliver for the simple reason that there are no unit tests. Without unit tests, bugs will be found later in the project life-cycle, possibly even after delivery. If customers have delivered software that is unusable, the fact of delivery becomes a negative pretty quickly..
On the positive side though, the tension between what's essential for the customer, and what developers need to learn to keep their careers alive is an interesting idea, and is something we've been looking recently at where I work. Is it a good idea to introduce a technology just because a programmer feels s/he should learn it? I'm not so sure.
So in your case you would notice that for iteration 3 you need some unit tests. Then you can write them in iteration 3. You didn't need them in iteration 1, hence no need to write them in iteration 1.
The concept of technical debt will probably inserted into the discussion here. I think it is irrelevant. Yes, there is always technical debt. For example, I currently have a technical debt of several billion dollars because I haven't installed big data centers like Google or Apple have. So should my web app ever need to scale to a gigantic level, I'll have a problem. But not now. So it is a debt I can live with.
Let's admit it, most devs don't test. There. I said it. Most devs just want to write more features, more new code, more design patterns, more cool algorithm.
Dev 1: "Testing? Testing is not my job. Go ask the QA to do it".
Dev 2: "Yeah... we're just not born to do testing, it's just not how our brain is wired".
Dev 3: ... more excuses why dev shouldn't test ...
I get it that devs aren't good at usability testing. But the majority devs I met don't even want to test their own code. Some don't want to write unit-test, some don't even want to test the functionality of the code they just wrote.
sigh
Proper unit tests with broad coverage are foundational to both of these ideas.
Personally, I think these pieces say more about their authors than they do about good programmers.
Keep in mind you can make something that is overengineered suck hard too. There is a happy medium between over engineering and hacking together crap.
The point is to have a whole bunch of tools at your disposal, the knowledge to correctly use each tool to it's maximum effect, and the courage of character to use that tool despite its unpopularity.
If you take away from this article that shipping trumps all, or COM multithreading sucks, or templates in C++ are buggy, you're missing the point entirely.