Programming Style
Principles
KISS principle
I prefer more simple algorithms and data structures because the simple implementation is easy and robust. On the other hand, the complex algorithms and data structures might be hard to implement and slow despite the theory.
Simple Data Structure
Specially, I emphasize the simple data structure and the working memory spaces because recent consumer electronic computers such as smart phones has powerful micro chips and it is no problem to compute O(n
2) steps. For example, I prefer a simple algorithm using O(1) spaces and O(n
2) steps than a complex algorithm using O(n) spaces and O(n) steps when the complex algorithm must have the overlapped data spaces to achieve the O(n) steps such as not in-place algorithms
References
- KISS principle
- Google C++ Style Guide
- Google Objective-C Style Guide