Live data from Hacker News

An empirical study on the impact of C++ lambdas and programmer experience

dl.acm.org

111–112 of 112 posts

Re: An empirical study on the impact of C++ lambdas and programmer experience

#111

Earlier quoted context omitted.

Out of interest, I never learned C but went straight to C++. What in particular about C++ makes you believe that you'll write memory hogging programs?

Specifically, the STL has a lot of slow containers that people readily use. For example, a beginner might see a std::map and think "wow, a handy hash table class!". First off, it's not a hash table (usually a RB tree). Second, the closest thing to a hash table in the STL (std::unordered_map ) is still pretty slow. Then there's std::string. Super nice in 95% of cases but can cripple an application if you have millions…

I see, interesting, thanks. I suppose the same problems arise attempting to use STL algorithms instead of using algorithms that are better suited to a specific container, eg. std::set::find instead of std::algorithm::find.

Being aware of what is happening and the best tools for the job I suppose! And knowing the STL inside out and its idiosyncrasies and foibles.

Re: An empirical study on the impact of C++ lambdas and programmer experience

#112

Earlier quoted context omitted.

Out of interest, I never learned C but went straight to C++. What in particular about C++ makes you believe that you'll write memory hogging programs?

I've seen a game engine built on shared_ptr that had trouble getting a 2D game performing well on the PS3. Its not that C++ will bloat your program, its that many programmers don't understand the tradeoffs of the primitives they're using, or don't have the experience or vision to see what they become at scale.

That last bit of your sentence is a great point - no vision to see what they become at scale, ie normally monstrous
Post reply on HN