890 Subj : Re: Threads suck To : comp.lang.c++,comp.programming.threads From : Phlip Date : Fri Jun 24 2005 02:50 pm Torsten Mueller wrote: > Phlip schrieb: > > > I often used the debugger to step thru the code and watch it work, > > but I never _needed_ to use the debugger. > > You never had to explain an application somebody else wrote, perhaps a > person using a strange programming style (this is because normally he > was a lisp programmer), speaking another native language and nobody > has seen him for years? That's out of context. I described a project I wrote from scratch. If someone gives you a program built by Debugger-Driven Development, you have no choice but to pick up where they left off. > No. You cannot guarantee a software quality by tests. Of course not. But you sure as hell can avoid long bug hunts. > I always have to > fight against this opinion (especially managers do think like this). > Tests are nothing but an emergency break, something one can use too if > nothing else has left (especially if the software's design and > implementation do not guarantee it's quality). So why not write tests before writing the tested code? That makes them efficient to write, turning them from a backup situation into a way to propel development. > > On review, the client liked the code structure and my coding style. > > And who is the client? A customer? I mean - a user? A programmer who must maintain that code. > > Threads make bug repression a nightmare because race conditions > > might behave in simple tests different from in production. > > Normally threads are testable non-threaded! In most cases you can > write down an entire algorithm, debug it, test it, optimize it, and > then you can say, this function runs as a thread now. OK, if you have > several concurrent threads it would be more complicated. Things which are hard to test should be avoided. That's a sign they bring too much complexity. If they are, in fact, the simplest spot between even more complexity, tests can detect this situation, and can reinforce the fixes. -- Phlip http://www.c2.com/cgi/wiki?ZeekLand . 0