3 ms·
https://github.com/facebook/folly https://github.com/facebook/folly
by nick0garvey 9y ago
https://github.com/facebook/folly https://github.com/facebook/folly
- fishnchips 9y ago+1 to Folly for elegant modern code, but their use of shared pointers is nothing to be proud of, at least in the C++ world.
- Frogolocalypse 9y agoI've yet to find a valid use for a shared_ptr. A unique_ptr is great to use for polymorphism but I've always thought if you can't figure out what owns what in memory in a program, you haven't planned it very well.
- pjmlp 9y agoThen I imagine you never had the fun of feature driven software development by consultants at enterprise level. Being one, this works like this. Company X, which main business has 0% to do with software development requires a new feature on an application being used at deparment Y. They send out an RFP to several consulting companies, the one that gets the gig, sends a few developers, which get a configured devenv from company X IT department and implemente the requested features and go away. Manual memory management languages became out of fashion in such kind of companies, because it is almost impossible to jump into a gigantic ball of mud, while keeping track of all ownerships.
- Frogolocalypse 9y agoI understand that you have legacy requirements to support elements that previous developers have used, but that doesn't explain why someone would use a shared_ptr in the first place. The great thing about unique_ptrs is that they take away the manual memory management. It is a complete PITA not having them. I can even see the use in weak_ptrs. My issue is with shared. I can't see how their use wouldn't lead to larger problems in code.
- pjmlp 9y agoWell, Windows projects with COM everywhere, and no access to the complete code, with responsibilities scattered across feature teams. Thankfully I only use C++ nowadays when we need to bind native libraries into Java or .NET projects, so since 2006 I never had to deal with such horror scenarios any longer.
- Frogolocalypse 9y agoI 'learned' (bumbled) through c++ almost 30 years ago. I formally learned both c and c++ properly through uni more recently. I'm not sure I'll ever use another language if i want to build something that is complex but i need to be really fast. I love c but the more complex the problem, the more infeasible it gets to use. But c++? There isn't a processing problem that you can come up with that you couldn't use c++ to resolve it with. Love the language.