by MaxBarraclough · 8y ago · 0 comments
24: Avoid the 'inner-platform effect' [0]
Make proper use of the machinery of the standard library.
This makes your code more readable, more portable, shorter, faster, and less error-prone, and it doesn't even take any real effort - indeed, it makes writing things easier!
The standard-library was probably written by someone smarter than you, almost certainly someone more familiar with the language than you, and it's definitely better tested, better documented, and, importantly, better known, than whatever you were about to write. This is a pretty basic point, perhaps, but most of them are.
Special case: use standard-library data-structures. If you're implementing your own hashset over a raw array, rather than using the standard HashSet class/template, you'd better have a very good reason.
I don't like the look of #10. I'm a believer in single-point-of-return.