TDD is BS?
Jacob Carlborg
doob at me.com
Thu Jun 20 02:59:16 PDT 2013
On 2013-06-20 01:44, Walter Bright wrote:
> I just can't accept that. For one thing, implementation details often
> must drive the interface. Just writing specs without any knowledge of
> how it would be implemented will not produce an efficient design.
>
> For the square root, there's a definite tradeoff between accuracy and
> speed. With no knowledge of those tradeoffs, and just coming up with a
> spec, how can you make the right decisions?
First, just because you have written a test doesn't mean you can't
change it. Second, if you need on beforehand that solving this
particular problem need to use a given algorithm which will require this
certain API, then write your tests to match that.
Otherwise, I would say, that write an API that is as straightforward and
easy to use as possible. Then benchmark and profile your code and see
where the implementation need to be change to satisfy your needs. If
changing the implementation requires you to change the API, then do that
and change the tests as well.
And in the end, don't be so religious about these things and use your
common sense :)
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list