News for hackers. Stuff that matters.
Re:Std::visit is everything wrong with modern C++ (2017) by socialdemocrat on Saturday December 05, 2020 @11:43PM (#25321097)
I have the complete opposite experience. Through my whole career writing C++, that language has been in the way due to all its idiosyncratic behavior. One spends so much time trying to figure out a way around some crazy boiler plate code requirement in C++ only to realize that no, it simply isn't possible to do it in a sane way in C++.

Switching to Swift I felt almost everything worked as it should. It was almost a bit boring not having to deal with all the usual crap that C++ would give me. I am willing to be you can write any C++ system much better in Swift. C++ would probably have a performance edge, but in 95% of cases not enough to be worth dealing with an ugly language like C++.

> C++ will continue to see a lot of usage as long as it is difficult or impossible to write code in other languages that is functionally equivalent to C++.

I would challenge you to give me any language construct that is indispensable for a particular type of program which cannot be done more elegantly in another language and with less headache.

I cannot think of a single feature in C++ which I have ever missed in any other of my preferred languages.

Re:Std::visit is everything wrong with modern C++ (2017) by jandrewrogers on Sunday December 06, 2020 @02:10AM (#25321758)
You likely design very different software systems than I do. I don’t have the luxury of ignoring performance, efficiency, and scalability. I don’t have any particular love for C++, there are many things wrong with it, but sadly there isn’t a practical alternative that doesn’t have worse trade offs. Ironically, I largely refused to use C++ until C++11. I delivered systems in a long list of other languages before that time; my usage of C++ is relatively recent. My choice is pragmatic and based on experience.

If you can’t think of reasons to use C++, that isn’t because reasons don’t exist.

Re:Std::visit is everything wrong with modern C++ (2017) by rualca on Sunday December 06, 2020 @03:37AM (#25322069)
> One spends so much time trying to figure out a way around some crazy boiler plate code requirement in C++ only to realize that no, it simply isn't possible to do it in a sane way in C++.

It seems you're complaining about the outcome of poor and ill-advised engineering practices instead of a programming language.

And your description also covey's the idea that you had people who knew very little about C++ trying to figure out how to use it in ways that they have no idea was possible to use.

I get the appeal of a good scapegoat. Yet, from your description it seems you're trying to dump the blame on a lot of engineering problems you're creating for yourself on a tool.

Re:Std::visit is everything wrong with modern C++ (2017) by a-nikolaev on Sunday December 06, 2020 @01:14AM (#25321537)
Maybe the idiosyncratic BS of C++ is what's hard to express in a saner language? If someone only used hammers all their life, then they will say that a microscope is a bad hammer, which is kind of true =D