Making the code more expressive.
Using STL algorithms with cppcheck
by Paul Fultz II
From the article:
From Sean Parent’s C++ Seasoning talk, he explains how raw loops suffer from several issues:
- Difficult to reason about and difficult to prove post conditions
- Error prone and likely to fail under non-obvious conditions
- Introduce non-obvious performance problems
- Complicates reasoning about the surrounding code
Instead algorithms should be preferred, either using the algorithms in the standard library or writing a new algorithm. Even more so, Sean Parent suggests that all coding guildines should be replaceed with “No raw loops” in order to improve code quality...
Add a Comment
Comments are closed.