4 ms·
You don't need to use or master every tool in the shed. The hard part about C++ is to choose the right tools and to avoid the bad parts. Things like memory man
by static_noise 11y ago
You don't need to use or master every tool in the shed. The hard part about C++ is to choose the right tools and to avoid the bad parts.
Things like memory management and concurrency are actually getting better.
- Put a smart pointer on the stack to handle your allocations. Share it and it persists. Forget about it and it deallocates your memory. No need to use raw pointers directly.
- Use things like futures to manage your concurrency. No need to know the finer semantics of mutexes just to pass around a few values.
- Templates enable a lot of cool stuff but you don't have to understand much about them to actually use them in a library.
That being said, if C solves your problems well, use it. There is nothing wrong with that. If you only need some parts of C++, use them where it actually makes sense.
- jandrese 11y agoThe only problem is that this makes it a bit of a write only language. When there is an ocean of language features you don't know much about because you never use them, it becomes a barrier to reading someone else's code and find that they use those features extensively. The worst is hotshot programmers that seem hellbent on using every feature a language offers because they just learned it in school and want to apply what they know, even though half of the time all they're doing is adding complexity for little gain.