r/cpp • • Jun 10 '15

Hitler on C++17

https://www.youtube.com/watch?v=ND-TuW0KIgg
440 Upvotes

248 comments sorted by

View all comments

Show parent comment

5

u/Sqeaky Jun 13 '15

Yes, processors hate indirection. But memory loves it.

I think you only try to make this argument because you don't realize you are arguing with an implementer. As much as I hate microsoft, STL is one of the devs on visual studio (I think the lead STL implementor) and a freaking genius. Every time I have gone to argue with him on some vehemently anti-ms I always fact check myself and I am wrong.

Also he is correct and it is trivially easy to check this with benchmarks. Memory usage is reduced with crafty indirection but execution time is increased with more queries to memory. All that matters is time in the end.

As for the rest of your claims. Where your complaints are valid you are complaining about older versions that have language fixes in places now. RAII allows us to create smart pointers. Smart pointers and other resource owning objects allow us to balance Memory Usage, CPU time, Code Readability and other concerns as each project demands.

Any forced strategy, particularly this references everywhere strategy interferes with this and forces decisions in that balance. If you need greater usability you have plenty of language options that follow the references everywhere strategy, (Java, Ruby, PHP, etc...). If you need performance it is hard or impossible to get the performance from them you can get from C++ and well formed C++ code is not always much harder to read.

-4

u/[deleted] Jun 13 '15 edited Jun 13 '15

All that matters is time in the end.

Sorry but this just made my head hurt.

Most consumer grade software on personal computers can afford to be reckless with their memory footprint because they typically run on systems that far supersede their hardware requirements. That doesn't mean it's good practice in general.

Mobile systems are still frequently memory constricted. Scientific computing applications on clusters and supercomputers are almost always memory constricted (I develop PDE solvers on an IBM BG/Q for a living). We are a long way away from memory no longer being a limitation in code development.

Explain to me why I should care about CPU time if rampant copy constructor calls prevents me from running my code on the size of problem I want to solve in the first place? Am I not better off taking a CPU time hit from indirection in exchange for reducing my memory footprint so that I can actually use a larger physical domain?

Your entire post is honestly one of the most egregious cases of horse tack. You're making proclamations about C++ efficiency that every single individual using the language on parallel systems would laugh at.

If you need performance it is hard or impossible to get the performance from them you can get from C++

Modern Fortran, which happens to be pass-by-reference, begs to differ. It blows C out of the water.

4

u/Sqeaky Jun 13 '15

I didn't even read your post, as per my previous post I am no longer responding to you. I must assume this was full of trolling and half-truths like your other posts.