Using late binding from C++

If you're working on Windows, COM is a great way to let Python and C++ collaborate. When you're consuming a COM server written in C++ from Python, the win32com module makes this a snap. Consuming a Python COM server from C++, however, can be a pain, because you have to use late binding. Note: I've […]

Hide your privates, but don’t be a prude

I recently re-read a great post by Alex Martelli on comp.lang.python about OOD in Python. Read the whole thing, it's brilliant. Alex basically says that most of the encapsulation mantra in languages like C++ and Java is due to (1) remnants of the much derided Waterfall style of software development (BDUF), and (2) deficiencies in […]

Getting GUI code into a test harness

You've got some legacy C++ code to support. The GUI code has almost no unit tests, but it works. But now you need to change it. Maybe you need to add a new menu item, or change a generic message box into a custom dialog. For whatever reason, you need to change your GUI code. […]

My kingdom for a decent C++ refactoring tool

These days, I use Python much more than C++ for development, but I've still got a lot of C++ code to maintain. Over the years, the code has gotten crufty in places — mainly GUI and COM automation code, because it's hard to unit test, and thus hard to refactor. That is, until I read […]