Saturday, April 15, 2006

DbC in standard C++ compiler

So, how should you write the contract in standard C++ or your C++ environment? You can get many sample codes from internet because many C++ programmers challenge the proposition.

Ironically, one of the best solutions is shown in D programming language's official site. It is the page that compares DbC of D with DbC of C++ and insists that D is more better than C++. But, that C++ code is very good hint to challenge DbC in the standard C++. This page teaches us that we must use much technique in C++ for realize DbC.

The similar challenger is there in Java. It will be difficult for us to realize DbC enough in C++ and Java unless these languages implement DbC as their spec. However, admiration to DbC will bring right use of assert. We often forget importance of assert.

No comments: