C++ Tips: Difference between revisions

Jump to navigation Jump to search
227 bytes added ,  7 October 2009
Line 15: Line 15:
== Standards ==
== Standards ==


* Use <tt>SG_LOG</tt> calls instead of <cout> and iostreams.
* Use <tt>SG_LOG</tt> calls instead of <cout> and iostreams. SG_LOG is controllable (partially so right now, moreso in the future) and the overhead of messages can be avoided at build time. <iostreams> can be expensive both at compile-time and run-time (not always, but if used naively).


* Use <tt>SGGeod</tt> instead of basic longitude/latitude/elevation doubles. It's easier to pass to other methods, type safe (can't confuse order of lat/lon) and unit-safe (degrees vs radians vs meters vs feet is explicit in the API).
* Use <tt>SGGeod</tt> instead of basic longitude/latitude/elevation doubles. It's easier to pass to other methods, type safe (can't confuse order of lat/lon) and unit-safe (degrees vs radians vs meters vs feet is explicit in the API).
580

edits

Navigation menu