I've not done a ton of Test Driven Development (TDD) but from my understanding of it I like the idea. It's like checking your work in math, only backward. It forces you to check your work. You can't say: I would have checked my work but I ran out of time. At least that is my layman's perspective.
But I think the benefits of TDD may actually stretch into the core problem solving of programming. We know you have to think differently when taking a TDD approach, but I think that it could actually make the problem solving easier, and actually make learning new languages or syntax easier too.
What am I talking about? I just watched a video that walks the viewer through building regex expressions and the host did so by taking a TDD approach. He started with a valid value, and wrote a simple regex that would pass anything. Then he began to harden up the expression until it properly found only the desired values. I went away from the video with a far greater understanding of regex than I had before (I typically hamfist my way through regex use, scouring regexlib and using their tester tool to make sure what I find will work for me. Now I actually understand the syntax and rules of basic regex expressions - AND I saw a great way to actually author my own instead of copying/pasting existing expressions.
All through the use of TDD style regex expression writing.
No comments:
Post a Comment