Debugging a bazaar plugin

Nicholas Allen allen at ableton.com
Fri Feb 9 16:29:48 GMT 2007


> Well, having a test suite makes a big difference. And you really need
> one for any language. type checking and such give you syntactic
> checking, but they don't actually tell you whether the function does
> what you think it does. Unit testing gives you that.
>   
I know this post is a little off topic!

I agree - I didn't mean to imply that a test suite should not be used in 
static languages. What I imagined would be a problem (and am surprised 
in a nice way that it doesn't seem to be ;-)) is that the programmer 
makes a silly typo and unless the test cases execute that line (which 
may require certain timing and complex conditions to hold true) then the 
typo has the chance to sneak through the test cases and peer review. 
Also test cases can take a long while to run (ours, for example, take 
about 8 hours) so being sure that you didn't make a typo via automated 
testing seems like it would be tedious way to do it. In Java, if one 
mistypes a method name, pass wrong number of args etc. I don't have to 
wait for test cases to pick this up. By the time I've typed it it is 
underlined with a message saying the method does not exist. So I just 
thought the development cycle would be much faster in this kind of 
environment.

One can also refactor classes and methods very quickly in Eclipse due to 
Java's static type checking. In Python, none of the IDEs have the 
artificial intelligence to do this reliably way or a way that I would 
feel confident in at least.

Also for someone new to the project it is harder to get into the code 
(at least in my opinion). When a method has a parameter named "path" for 
example is that an object defined by a high level class that has methods 
for opertations on a path and handling it in an OS portable manner or is 
it just a simple string? In a static language it is immediately obvious 
but in a dynamic one it's not so obvious. Static typing is more explicit 
but you read code a lot more often than you write it so I think being 
explicit is a benefit not a hindrance...
> I've also find not having the "compile" step really is an advantage. At
> least with the heavily templated C++, I've had compile times as long as
> running the whole test suite, because I added a comment to a core header
> file.
>   
This is a major problem in C++. It does not scale well - it is a 
horrible language. There's no way I would voluntarily use it for 
anything but unfortunately at work I have to ;-(

In Java most modern IDEs support incremental compilation which means you 
can run the program as soon as you finished typing your code. C++ is so 
badly designed that incremental compilation is almost impossible.
>
> Sometimes I miss having better Intellisense. But I trade that off by
> having a much more powerful editor. :)
Just out of curiosity - what editor do you use?

Nick




More information about the bazaar mailing list