Design by Contract - with C

djberg96 on 2004-10-31T15:34:20

Charlie Mills has written an article over at onlamp.com regarding design by contract in C. Very nice.

Matz is a fan of DBC as well, and that is why he plans on adding pre, post and wrap hooks in Rite (Ruby 2.0). I don't know that I'm sold on DBC in dynamic languages, however. Any special plans for Perl6?

That had me wondering what had been done for Perl with regards to DBC. Sure enough, there's a module, Class::Contract out on CPAN for just such a thing.

I should also mention that I had the pleasure of meeting Charlie Mills at RubyConf 2004. Nice guy, and clearly a good C programmer. He helped me debug a C extension that was segfaulting because I didn't declare a few of my variables as 'volatile'. :)