Published online by Cambridge University Press: 05 March 2013
Recommended programming practices
The following is a list of recommended programming practices designed to increase the reliability of scientific computing software, along with a brief description of each practice.
Use strongly-typed programming languages
Although there is some ambiguity in the definition, here we refer to a strongly-typed programming language as one which (1) requires that a variable or object maintain the same type (e.g., integer, floating point number, character) during program execution and (2) has strict rules as to which types can be used during operations (i.e., implicit type conversions are not allowed). Common examples of the latter are the use of integer division on floating point numbers and the use real functions (e.g., cos, log) on integers. BASIC and C are considered weakly-typed languages, while C++, Java, Fortran, Pascal, and Python are considered strongly-typed. For type information on other programming languages, see en.wikipedia.org/wiki/Template:Type_system_cross_reference_list. A type-safe program can be written in a weakly-typed language by using explicit type conversions (to convert integers to real numbers, real numbers to integers, etc.). In other words, explicit type conversions should be used, even when not required by the programming language.
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.
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.
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.