4 ms·
There is an alternative: writing simple C++ instead of Modern C++, or even using plain C.
by adrianN 8y ago
There is an alternative: writing simple C++ instead of Modern C++, or even using plain C.
- gok 8y agoBy simple you mean without the STL?
- Koshkin 8y agoThen you increase the time you need to spend writing your program. You will also most likely end up cutting some corners, and the result will be of questionable quality in one way or another.
- thezilch 8y agoHolding in my brain and using all these "modern" features increases the time I need to think about code, data, and algorithms, and that's usually where most coding spends my time -- thinking. And "modern" compile times... increasing the time between results and further thinking and writing. Don't forget that; the article doesn't. And "modern" debugging... well, good luck.
- Koshkin 8y agoWell, people have been known to hold in their brains information pertinent to their trade. Professional training helps, too. I can only guess the extent of what a mathematician, a physicist or a medical doctor must remember to be successful in what they do.
- pjmlp 8y agoMusicians are able to hold complete compositions on their heads, some of them several minutes long. It is all a matter of focus and pratice.
- kgabis 8y agoCode is not music. When thinking about code you must keep track of possible branches executed code might take and properties of the physical machine it runs on. C++'s complexity can hide code's underlying logic and make some types of bugs more common.
- pjmlp 8y agoAs someone that learned music and several instruments before getting into computing, and having spent several evenings with musician friends, I beg to differ. Writing a composition score for an orchestra falls under similar conditions, how each instrument sounds, how they sound together, when each comes and goes into play, and so forth. Most complaints about C++'s complexity can be equally applied to languages that look deceivably simple like Python. Complexity is like thermodynamics, it gets pushed somewhere, if it isn't on the code, it gets shoved either into boilerplate, or architecture.
- thezilch 8y agoIf we can compare C++'s complexity to Python's, then C++ has lost its way. You're saying the same thing as the article and my comment, that C++ is trying to hide complexities, and we're arguing that doing so is instead adding more complexities. Sure, Python makes it easy to listen on a socket, parse HTTP, and send HTML down -- hiding a lot of complexity. But it's made it impossible to do so very efficiently and scale up. Try and dive into Python's stack for that (Re: 'hold in your brain all the "modern" features'), and you'll get lost in a myriad of CPython (or whatever flavor you choose) generics and indirection that you can't optimize. Startup times matter, because you are all about hiding complexities and went "serverless" and constantly eat cold starts (Re: '"modern" compile times'). I think it's apt to compare "modern" C++ as moving towards something like Python. Not great for a lot of applications of C++ (Re: games, in the article and my focus) or its perceived goals as a better C. That's the point. Many of the C++ additions are being slagged for making a worse C. It's looking nothing like C any longer. It's a giant ball of complexity with dozens of ways of doing the same thing and hoping you learned them all. This is why I think languages like Rust (or even Go) get a lot of attention. They have a good interop story with C, like C++ has. And if we're going to learn a bunch of non-C looking language grammar, C++ is doing a worse job.