03.12.2012 Views

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

200 CHAPTER 7. EFFECTIVE PROGRAMMING: THE POLYMORPHIC WAY<br />

far already deal with some kind of code reusability, but mostly in an implicit way. The following<br />

section overview polymorphic mechanisms in a more explicit way.<br />

As soon as code reusability is covered, an almost equal importance is placed on code extensibility,<br />

which should not be constrained by reused code. Scientific code development is always<br />

driven by trans<strong>for</strong>ming newly developed scientific methods into executable code. Various programming<br />

techniques with different scopes are there<strong>for</strong>e mandatory. If programming techniques<br />

are analyzed this way, it becomes understandable why some of the presented programming<br />

paradigms are not ideally suited to accomplish code reusability and extensibility together (e.g.,<br />

the object-oriented inheritance model).<br />

No technique, or more generally paradigm, will result in the ultimate and final solution, but<br />

each of the techniques results in tools to manage the complexity of a problem. It does not give<br />

you the ability to do so. A bad problem specification will lead to a bad solution independently<br />

from the technique or paradigm used <strong>for</strong> implementation.<br />

The usage of the Boost graph library (BGL) is an excellent example. There is great diversity<br />

of requirements in the field of graph algorithms and data structures. Even so, the per<strong>for</strong>mance<br />

claim <strong>for</strong> a library like this, is very high. Nevertheless, it was possible to implement all necessary<br />

functionality at a high per<strong>for</strong>mance level. More than this, the library can be extended greatly<br />

in many different ways. But on the other side, this library is not easy to use or extend without<br />

an understanding of the underlying techniques.<br />

And as a reminder of the main goal of this book is how to write good scientific software.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!