News for hackers. Stuff that matters.
Re:Ask YC: Does anybody enjoy unit testing their code? by einarvollset on Thursday June 12, 2008 @01:44AM (#215697)
Nope. Hate unit testing. Never do it. Makes me more invested in my existing code so I'm less likely to throw out previous versions.
Re:Ask YC: Does anybody enjoy unit testing their code? by chrisbroadfoot on Thursday June 12, 2008 @06:33AM (#215816)
So, you throw away previous versions without knowing that your new code actually works with your existing integration points?

Ba bow.

Re:Ask YC: Does anybody enjoy unit testing their code? by einarvollset on Thursday June 12, 2008 @07:12PM (#216383)
There's a difference between checking that the code works overall, and checking that each individual component works.

Anyways, I realize I'm in the minority (in many ways..), but I find that if I have a crapload unit tests, then I'm more inclined to not want to change how something works (because then I'd need both new code AND new unit tests - for everything).

To me, that's a bad thing

As an aside, is there any studies that show that the proliferation of unit testing in the last few years has actually reduced the number of bugs and/or decreased development time _overall_?

Re:Ask YC: Does anybody enjoy unit testing their code? by felipe on Thursday June 12, 2008 @01:47AM (#215701)
Unit testing written first actually forces you to throw away bad code more often. The test is independent from the production code.
Re:Ask YC: Does anybody enjoy unit testing their code? by einarvollset on Thursday June 12, 2008 @07:14PM (#216384)
Not exactly: It forces you to throw away bad code inside a component _that conforms to the unit test_. If the unit test inherently tests something that isn't optimal for the larger problem then you're no further.
Re:Ask YC: Does anybody enjoy unit testing their code? by bhb on Thursday June 12, 2008 @10:10AM (#215937)
It does make it harder for me to completely throw out older versions, but it makes it way easier for me to refactor my old version into a better new version (which I think is often more productive than just starting from scratch)