Don't call your functions too often
Pass pointers rather than by reference
Know what your computer is doing - what is going on under the hood?
Providing types at compile-time
If using an interpreted language: Vectorize!
Compilers can be smart, and can speed up one-dimensional loops. They have a harder time to figure out of how to make nested loops faster.
A test that makes sure that one function in your code (or one small, and very well defined part of your code) works properly.
Bigger scale tests, that usually combine many functions, and to check if they are working correctly together. For example: Calculating the Planck spectrum and then write the results to an external ASCII file.
Its a way to see if the program says: "Hey! There is a problem here!" - then if you don't have a
Try-Catch clause your program will crash.
IF statement can also work if you know how it can fail.
However, the advantage of Try-Catch is that you can catch some errors that are buried deep down maybe.
Still, its a much more expensive way to deal with a problem, rather than using an
Its for things that don't have a clear order. It doesn't really happen too often in scientific programming.
Good places to use would be in I/O, and networks.
It kind of depends on your problem. They key is to think about: "How are you gonna parallelize it?"
It can be
embarrassingly parallel , and you can then basically distribute the serial code to a lot of workers and gain speedups that way. If not, then you can also go into the idea of parallelizing at multiple levels.
Guðmundur Kári Stefánsson| 500px | vimeo | facebook |
email: gws5257 [at] psu.edu
09 March 2015 Installing a CDK24 Telescope at Penn State
06 December 2014 A Day in Pittsburgh
12 November 2014 HET trip - Results
11 November 2014 HET trip - day 1
01 October 2014 Black Moshannon State Park Observing
29 September 2014 HPF MLI blanket fabrication
19 September 2014 MLI Blankets
11 August 2014 HPF subsystem assembly
21 July 2014 Astrofest 2014
13 June 2014 HPF - Keeping it cool