News for hackers. Stuff that matters.
Re:Why I don’t use TDD or BDD by derefr on Saturday September 04, 2010 @05:30PM (#1663428)
The only real way there has ever been to make sure the computer is following your instructions, is to tell those instructions to it twice. (Non-inferential) static typing is about telling the computer the input and output types of your functions twice. Unit tests are about telling the computer the algorithm (or an equivalent, such as a direct mapping function from a subset of example inputs to pre-calculated outputs), twice. These are both just protoforms of Reliable Computing—the name for the actual software engineering that NASA and friends do, where they make the whole system twice (or more) and then run those systems in parallel to ensure they're always "voting" the same way.

But sometimes you don't need engineering; sometimes you just need a dirty hack. Hacking is basically the opposite of engineering: it espouses DSLs and macros that encode everything exactly once, it prides elegance and other aesthetic factors of code above engineering tolerances. And, of course, it's a lot more fun to do—so it gets people interested in your code, which can actually be the best thing, even more so than engineering it. Linux is a big hack, and because of that all sorts of people enjoy working with it. _why was an eminent hacker, and because of that his code (and tutorials) are still used when getting people interested in coding. None of this code is guaranteed to work, unlike code that has been engineered—but that's okay, in 99% of cases.

Re:Why I don’t use TDD or BDD by tomstuart on Saturday September 04, 2010 @05:37PM (#1663444)
To elaborate: you tell the computer a specification ("what to do"), you tell the computer an implementation ("how to do it"), and then you get the computer to check that the implementation conforms to the specification.