Skip to main content Accessibility help
×
Hostname: page-component-78c5997874-g7gxr Total loading time: 0 Render date: 2024-11-06T05:29:47.307Z Has data issue: false hasContentIssue false

3 - Priorities

Published online by Cambridge University Press:  28 January 2010

Suely Oliveira
Affiliation:
University of Iowa
David E. Stewart
Affiliation:
University of Iowa
Get access

Summary

Let's get this straight. Your priorities in writing scientific software should be, roughly speaking:

  • correctness,

  • numerical stability,

  • accurate discretization (including estimating accuracy),

  • flexibility,

  • efficiency (speed and memory).

If your program is not correct, then nothing else matters. If the algorithm is not numerically stable, the results cannot be trusted (at least not unless you test them first). If the discretization or other approximations used are inaccurate we will still not be able to trust the results. Even better is to have a method that can estimate the errors in the discretization and approximations. The estimates don't have to be exact (if they were, we could compute the exact values), but good enough to give a reasonable idea of their size.

If the software is not flexible, then others probably won't use it, since they will have a hard time making it do something slightly different. Once we have a correct implementation of a numerically stable algorithm, then we can think about how to make it fast. Speed is still one of our priorities, but it comes last. Don't forget memory. If your algorithm needs more memory than your machine has, then it won't run. And sometimes this is more important than speed.

Correctness

Without correctness, we really can't expect any useful results. So we must first make sure that our programs bug-free. Since human beings make errors even for the simplest tasks (and programming involves a great deal of thought), the probability that someone can write a bug-free program of any significance without debugging is close to zero.

Type
Chapter
Information
Writing Scientific Software
A Guide to Good Style
, pp. 30 - 35
Publisher: Cambridge University Press
Print publication year: 2006

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Priorities
  • Suely Oliveira, University of Iowa, David E. Stewart, University of Iowa
  • Book: Writing Scientific Software
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511617973.004
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Priorities
  • Suely Oliveira, University of Iowa, David E. Stewart, University of Iowa
  • Book: Writing Scientific Software
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511617973.004
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Priorities
  • Suely Oliveira, University of Iowa, David E. Stewart, University of Iowa
  • Book: Writing Scientific Software
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511617973.004
Available formats
×