RFC 8: Developer Guidelines

Author: Frank Warmerdam
Contact: warmerdam@pobox.com
Status: draft

Purpose

This document is intended to document developer practices for the GDAL/OGR project. It will be an evolving document.

Portability

GDAL strives to be widely portable to 32bit and 64bit computing environments. It accomplishes this in a number of ways - avoid compiler specific directives, avoiding new, but perhaps not widely available aspects of C++, and most importantly by abstracting platform specific operations in CPL functions in the gdal/port directory.

Generally speaking, where available CPL functions should be used in preference to operating system functions for operations like memory allocation, path parsing, filesystem io, multithreading functions, and ODBC access.

Variable Naming

Much of the existing GDAL and OGR code uses an adapted Hungarian naming convention. Use of this convention is not manditory, but when maintaining code using this convention it is desirable to continue adhering to it with changes. Most importantly, please avoiding using it improperly as that can be very confusing.

In Hungarian prefixing the prefix tells something about about the type, and potentially semantics of a variable. The following are some prefixes used in GDAL/OGR.

Prefix can be stacked. The following are some examples of meaningful variables.

It may also be noted that the standard convention for variable names is to capitalize each word in a variable name.

Headers, and Comment Blocks

Misc. Notes


Generated on Fri Aug 10 08:50:17 2007 by  doxygen 1.4.7