Magnus Lycka wrote: > Randall Parker wrote: > > Also, compile time errors get caught sooner. They get caught before > > tests even get written. > > Not if you do Test Driven Tevelopment. Then you write > the tests before you compile your target code! It's > also my experience that the write test - write code > - run test cycle in TDD with Python is often faster > than the plain edit - compile cycle in C++. More > extensive tests take longer, but so does linking of > C++ code...
Magnus, I see a problem with your argument: On the one hand you say that Python's lack of type declarations can be compensated for by Test Driven Development. But then you say Python has a bigger advantage in situations where requirements are not well defined. Well, when requirements are in flux and being explored during development it is a waste of time to write tests to test against nebulous requirements. TDD and poor requirements don't mix very well. As for changing argument types: But this is exactly the sort of situation where I find myself getting into trouble in Python. I have to change some type and I forget everywhere I've passed it or returned it. In C++ if I make changes the compiler is going to keep complaining and pointing out type clashes I've introduced due to changing a variable's type. Granted, it is a pain to change type declarations. But visiting those places often makes me think thru the ramifications of changes. Also, I've been on projects where the whole purpose of my code has been to test equations and control laws (this was for space probes to places like Eros and Saturn btw). We were certainly doing test driven development in one sense. But the assumption the systems engineers wanted to make was that the algorithms were written correctly in code and that if the system didn't behave correctly then the problem was in the algorithms, not in the code. We therefore were not in a position to do test drive development on the code itself. -- http://mail.python.org/mailman/listinfo/python-list