Donald Knuth Rips On Unit Tests and More 567
eldavojohn writes "You may be familiar with Donald Knuth from his famous Art of Computer Programming books but he's also the father of TeX and, arguably, one of the founders of open source. There's an interesting interview where he says a lot of stuff I wouldn't have predicted. One of the first surprises to me was that he didn't seem to be a huge proponent of unit tests. I use JUnit to test parts of my projects maybe 200 times a day but Knuth calls that kind of practice a 'waste of time' and claims 'nothing needs to be "mocked up."' He also states that methods to write software to take advantage of parallel programming hardware (like multi-core systems that we've discussed) are too difficult for him to tackle due to ever-changing hardware. He even goes so far as to vent about his unhappiness toward chipmakers for forcing us into the multicore realm. He pitches his idea of 'literate programming' which I must admit I've never heard of but find it intriguing. At the end, he even remarks on his adage that young people shouldn't do things just because they're trendy. Whether you love him or hate him, he sure has some interesting/flame-bait things to say."
I saw "Donald Knuth Rips One" (Score:1, Funny)
Re:Literate programming... (Score:1, Funny)
I've only proven that it works... (Score:3, Funny)
those damn kids (Score:3, Funny)
Maybe More Like 50-75 Times a Day (Score:5, Funny)
Assuming you work an 8 hour day, that means you are testing your code every 2 minutes and 24 seconds. Given that most of your tests will take this long to run (you've got a suite of them right?), that leaves you with zero time to actually do the work you are testing.
Frankly, if you are using Unit Tests you should be using them after major chunks of work, not in a trial and error fashion. Now if you were using them in a trial and error fashion - "lets change this, run the tests and see if they pass, no that didn't work, lets try this", etc, I could understand how you hit the 200 times per day mark.
But the thing is that my employer loves my work and my code rarely breaks. Now why is that? Perhaps because I'm regression testing at all times? Perhaps it's because I take the time to think about things before I do them and, as a result, I really begin to understand what it is that I'm writing.
An added benefit is that I've found I can look at my or others unit tests and really understand what was going through their mind when the first wrote the method that I am expanding. It's quite interesting, but I'm sure you are a supreme being like Knuth and don't bother with such trivialities.
Here's a question: how much time do you spend working out what happened when your code breaks? TDD is a trivial amount of time compared to that. I am concerned about my software in the present and future. I wish others were also.
I know it will most likely result in a swift abrasive response but I implore your highness to really spend some time understanding how unit tests can help the really stupid coders (like me).
Re:Literate programming... (Score:5, Funny)
#define BeginWhile {
#define EndWhile }
#define BeginFor {
#define EndFor }
Re:Literate programming... (Score:3, Funny)
An so on...
Very common species... The COW-WORKER...
Re:Literate programming... (Score:5, Funny)
http://unix-archive.kalwun.de/PDP-11/Trees/V7/usr/src/cmd/sh/mac.h [kalwun.de]
Re:Shocked (Score:2, Funny)
You're full of shit.
Re:Literate programming... (Score:3, Funny)
Re:What? (Score:3, Funny)
Re:You misunderstand (Score:2, Funny)
Re:Literate programming... (Score:5, Funny)
}
}
You read that right. if-loop.
Re:You misunderstand (Score:4, Funny)
I don't have to tell people why I do it. I do it for money. Well, sometimes for love and world peace, but that's rare.
Re:Literate programming... (Score:2, Funny)