GEOS Coding Patterns
This page documents coding patterns followed in the GEOS codebase.
The patterns are intended to improve: understandability, consistency, performance, and memory safety.
Code should follow the patterns given here, unless this is not possible for compatibility reasons. Older GEOS code may not adhere to all patterns, but the goal is to update it when possible.
- Return created objects using
- To take ownership of a returned object use
To Be Investigated
Geometry Factory improvements
- Remove old create methods once all code is switched to using
- To reduce boilerplate perhaps define typedefs for common types:
Coordinate Sequence improvements
- Improve performance by avoiding virtual function calls
- Support immutable use of external coordinate sequence formats
- Virtual functions
- Are they really a performance hit?
- Use templates?
- Remove mutating methods where not strictly needed
- Mark non-mutating methods as const to allow immutable use of external coordinate sequence formats
- Will this work?