Debugging a bazaar plugin

John Arbash Meinel john at arbash-meinel.com
Fri Feb 9 16:00:22 GMT 2007


Nicholas Allen wrote:
> Thanks. I have to say, I'm really quite impressed at how quickly bzr is
> developed and how rock solid stable it is given the lack of integrated
> debuggers/tools, it's needed complexity, and lack of static type
> checking due to choice of Python language. I guess this would be
> impossible without the unit tests. I've always been a fan of static type
> analysis as it enables better tool integration, detection of spelling
> mistakes in method names, better refactoring, navigation and
> documentation. Coming from a static type background it can be
> frustrating once you are used to the tools and these benefits.
> 
> Anyway, it could take me a while to get used to Python tools and
> language but I hope I can contribute something back soon ;-)
> 
> Nick
> 

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'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.

That and python just having more flexibility and functionality out of
the box. Like being able to change your dict from mapping from a string
to an integer, into a string to a tuple, without having to
search/replace all the places you are defining std::map<std::string,
int> to std::map<std::string, std::pair<std::int, std::string> >. And
then realize that you didn't really want to change it.

I know you can do a bit better with typedefs, but then you need a lot of
typedefs, and you need to come up with reasonable names for those typedefs.

Also, duck-typing can be wonderful. You could think of everything as
being templates (coming from a C++ background). Where the parameters you
pass just have to conform to what is requested from them. Rather than
having to have everything be inherited from the right class.

Sometimes I miss having better Intellisense. But I trade that off by
having a much more powerful editor. :)

John
=:->



More information about the bazaar mailing list