Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can do almost anything in C++ at least three different ways. Most places that care about engineering will not have you do abusive template metaprogramming or go crazy with macros, even though it’s possible to do in the language.

The std library is filled with bad implementations that can’t change because of backwards compatibility. So it’s not your fault that they look confusing. The pointer types you mentioned are actually quite simple, think of them as thin wrappers over raw ptrs with constructors/destructors that implement counting (for shared ptrs) and whose destructors do the delete operation (for unique ptrs, and for shared ptrs once they reach 0 copies).

Working with C++ can be easy and fun as long as you aren’t in a codebase where people went overboard with anti patterns or “cleverness”.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: