2 ms·
My comment started with "C++ FAQs are full of massively complex conundrums like this for problems you just don't get in other languages" so I was making a gener
by seanwilson 10y ago
My comment started with "C++ FAQs are full of massively complex conundrums like this for problems you just don't get in other languages" so I was making a general comment prompted by the article.
> C++ is meant for low level system programming, when performance or size are constraints on the problem you're trying to solve. The problem domain itself entails a certain amount of care.
Agree with this but my view is you should avoid C++ at all costs if practical because of its productivity and bug risk impacts compared to other solutions. If low level is required though your options are limited.
> Also, JS and Ruby are indeed just as hard to master as C++.
We'll have to agree to disagree then because C++ is an order of magnitude more complex in my eyes. Code golf isn't a good metric to me as that's all about using obscure tricks to write as few characters as possible which isn't how you code normally. I would rather measure how easy it is to write code with minimal bugs and C++ gives you a million ways to shoot yourself in the foot.
- ksk 10y agoIMO, Code golf is an excellent metric. Only someone who masters a language and knows its weird edge cases and obscure syntax can make sense of the answers, or attempt to present an answer themselves. If writing code with minimal bugs is your goal, then you don't need to master the language at all. So, I don't even know what we're arguing about. Looks like we agree on most things. So lemme ask you, can you name books (or courses) that teach C++, and devote a significant chunk (or any) of the material to cover such arcane syntax topics? Yes, C++ is complex, because the underlying hardware is complex - and you want to get as close to the hardware as possible. After all, you're basically signing up to repair and service the car yourself, versus bringing it in at the dealership.
- seanwilson 10y ago> IMO, Code golf is an excellent metric. Only someone who masters a language and knows its weird edge cases and obscure syntax can make sense of the answers, or attempt to present an answer themselves. To me, mastering a language is knowing how to use it in a way to solve a problem in the fastest development time with minimal bugs and maintainable code which does not match up with code golf. C++ gives you lots of ways to introduce weird bugs which isn't something code golf demonstrates. > So lemme ask you, can you name books (or courses) that teach C++, and devote a significant chunk (or any) of the material to cover such arcane syntax topics? The C++ Programming Language book and Effective Modern C++ are good and they're full of "don't do this or something bad will happen!" parts. I'm not really concerned about a few arcane syntax problems but I am concerned that C++ has a lot of undefined behaviour that lets you shoot yourself in the foot in a way that other languages avoid.