Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For most people the easiest way to see what using an API looks like is to use it. And the emergent design that results can often be better than what you would have designed if you tried to design by thinking about it without writing code. http://c2.com/cgi/wiki?WhatIsAnAdvancer


That's not really answering the question I asked.

And writing an API takes up a small proportion of my time. Usually its generating database queries, and spitting them out as web pages, and presenting the data in a way that non technical users can understand.


If you're spending a substantial proportion of your time generating database queries or rendering results to web pages you should look at using better libraries for doing so, and/or improving your own library-type code.

If you're talking about figuring out how best to present the data, that's not really "development" per se. But it is another kind of API, and again something that you can design more effectively using a test-oriented approach (e.g. start by figuring out the use cases for what a user wants to find out from the information).


How do you know I am not using good libraries libraries for writing my code? (I usually use Django which seems to be well respected). Again, that has nothing to do with test driven development.

I already start by figuring out what the user wants. Again, nothing to do with writing a load of tests first.

All your suggestions for how TDD will improve my development seem to point to exactly what I do already without writing tests first.


> How do you know I am not using good libraries libraries for writing my code?

You said "writing an API takes up a small proportion of my time. Usually its generating database queries, and spitting them out as web pages...". Which suggests to me that you're not using libraries effectively, because those things are a tiny proportion of my time. The business logic - i.e. the part that's actually specific to your problem - should be where you spend most of your time, and that's the part where TDD is effective.

> I already start by figuring out what the user wants. Again, nothing to do with writing a load of tests first.

Writing a test for a use case ensures you actually understand it. It helps you find more possible problems or misunderstandings in the same way that a blueprint is an advantage over a sketch. And it's probably the most effective way to communicate these use cases to developers you're collaborating with.


Wow, so without knowing very much about my work, you are able to tell me where I should be spending the majority of my time.

And how does writing a test ensure that I understand a problem any more than not understanding it? If I don't understand it properly I will likely write the wrong test.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: