News for hackers. Stuff that matters.
Re:Kent Beck: “I get paid for code that works, not for tests... by cheez on Thursday December 08, 2016 @09:26AM (#13130425)
I spent some time working for one of the biggest names in trading technology and one of the things I learned is that if your code doesn't work on more or less the first try, your design is probably wrong. The implications of that lesson are profound.

When something doesn't work as expected, I now check my design and not the code.

Re:Kent Beck: “I get paid for code that works, not for tests... by pc86 on Thursday December 08, 2016 @09:29AM (#13130436)
> if your code doesn't work on more or less the first try, your design is probably wrong

Or you're tired. Or you're just not as focused as you could be. Or you have a deadline. Or you're trying something new. Or you're not fluent in the language yet. Or you're fluent in the language but not the framework. Or you're fluent in the language and framework but not the design pattern (if you use those).

Or a whole host of other things.

I'm not saying spot-checking the design isn't a good idea, but saying that it's the design more often than the code just doesn't match up with my experience.

Re:Kent Beck: “I get paid for code that works, not for tests... by cheez on Thursday December 08, 2016 @10:27AM (#13130845)
The entire idea is to increase the probability that you are correct. So if you're coding tired, you're decreasing that probability. If you're using a framework you're not familiar with, you're decreasing that probability. This is why I mentioned that it was in trading technology: they only get paid to be right.
Re:Kent Beck: “I get paid for code that works, not for tests... by lordnacho on Thursday December 08, 2016 @09:40AM (#13130522)
How do you define "the first try"? Surely you're bound to have various trivial issues?
Re:Kent Beck: “I get paid for code that works, not for tests... by cheez on Thursday December 08, 2016 @10:23AM (#13130818)
Something along the lines of after fixing obvious stupid things like those trivial issues.
Re:Kent Beck: “I get paid for code that works, not for tests... by d_theorist on Thursday December 08, 2016 @10:14AM (#13130756)
I remember once my code worked on the first try. I found it difficult to believe.
Re:Kent Beck: “I get paid for code that works, not for tests... by cheez on Thursday December 08, 2016 @10:28AM (#13130848)
One time in uni, I had no access to a computer and wrote an entire b-tree implementation on paper for a course, typed it in and it worked.

Based on a true story

Re:Kent Beck: “I get paid for code that works, not for tests... by eveningcoffee on Thursday December 08, 2016 @07:38PM (#13135712)
In principle TDD is the opposite of this.

Out of curiosity, did you use any debugging on paper for your code?

Re:Kent Beck: “I get paid for code that works, not for tests... by cheez on Thursday December 08, 2016 @07:45PM (#13135756)
I can't recall, honestly
Re:Kent Beck: “I get paid for code that works, not for tests... by jimmaswell on Thursday December 08, 2016 @10:31AM (#13130869)
I've found it to happen very often the past few years
Re:Kent Beck: “I get paid for code that works, not for tests... by throwayawnotime on Thursday December 08, 2016 @10:14AM (#13130758)
Did this comment really deserve a downvote? Upvoting accordingly!
Re:Kent Beck: “I get paid for code that works, not for tests... by pc86 on Thursday December 08, 2016 @10:35AM (#13130892)
Maybe not, but this one certainly does.