<story><title>Std::visit is everything wrong with modern C++ (2017)</title><url>https://bitbashing.io/std-visit.html</url></story><parent_chain><item><author>GnarfGnarf</author><text>I&amp;#x27;ve been writing C++ since 1990. I make a good living from a little C++ app (500KLOC) that sells in fifty countries. I love the ultra-static typing. It&amp;#x27;s saved my bacon many a times.&lt;p&gt;Long ago &amp;quot;modern&amp;quot; C++ crossed into a territory that I will never understand or use. STL is the fanciest stuff I write. Code needs to be maintainable. If I have to hire geniuses to collaborate on my code, that&amp;#x27;s not going to be cost-effective. So I use a conservative subset, and thank my lucky stars I don&amp;#x27;t need to pay attention to the latest exotica.</text></item></parent_chain><comment><author>dkersten</author><text>&amp;gt; Long ago &amp;quot;modern&amp;quot; C++ crossed into a territory that I will never understand or use.&lt;p&gt;Do you know where the line is? C++11? Later versions?&lt;p&gt;I ask because I quite like a lot of the changes that C++11 brought to the language, I feel they make my code much simpler to understand and maintain, but I got very confused by post-11 C++ for a long time to the point where I said I&amp;#x27;d never bother with C++17 or later (14 turned out not to be too scary once I actually sat down with it) because 17 and 20 added so much stuff that just looked beyond me. But I&amp;#x27;ve since changed my mind and have started to experiment with C++20, after I sat down and read a few articles and watched a few cppcon videos on the changes. I don&amp;#x27;t know &lt;i&gt;all&lt;/i&gt; that these versions have to offer, but I do understand the main changes enough to get by and most of them do make the language better, in my opinion.&lt;p&gt;Overall, the language is a mess, simply because they keep adding to it and very little stuff gets deprecated, removed, changed or cleaned. That leaves a large and messy language, especially compared to more recent deliberately-designed languages, but it turned out I could understand &amp;quot;most&amp;quot; of the things, once I had someone explain them to me. A few times ;)&lt;p&gt;Having said that, it probably isn&amp;#x27;t worth your time to &amp;quot;modernise&amp;quot; the C++ in your money-making codebase at this stage, if you&amp;#x27;re comfortable with it how it is. You likely wouldn&amp;#x27;t see a return in the effort it would take.</text></comment>
<story><title>Std::visit is everything wrong with modern C++ (2017)</title><url>https://bitbashing.io/std-visit.html</url></story><parent_chain><item><author>GnarfGnarf</author><text>I&amp;#x27;ve been writing C++ since 1990. I make a good living from a little C++ app (500KLOC) that sells in fifty countries. I love the ultra-static typing. It&amp;#x27;s saved my bacon many a times.&lt;p&gt;Long ago &amp;quot;modern&amp;quot; C++ crossed into a territory that I will never understand or use. STL is the fanciest stuff I write. Code needs to be maintainable. If I have to hire geniuses to collaborate on my code, that&amp;#x27;s not going to be cost-effective. So I use a conservative subset, and thank my lucky stars I don&amp;#x27;t need to pay attention to the latest exotica.</text></item></parent_chain><comment><author>ensiferum</author><text>Some of the modern c++ is a what I&amp;#x27;d consider &lt;i&gt;essential&lt;/i&gt; really. And there&amp;#x27;s plenty more that is &lt;i&gt;very&lt;/i&gt; nice to have.&lt;p&gt;Move semantics and unique_ptr are really IMHO essential. Then lots of nice to have stuff such as, shared_ptr, threads, lambdas (make STL a lot more usable).&lt;p&gt;Personally I&amp;#x27;d not want to be maintaining a C++98 style of code base at this point.&lt;p&gt;That being said you have probably already written all of the &amp;quot;nice to have&amp;quot; stuff so there&amp;#x27;s no real value benefit to go and replace it as such. So I understand your POV as well. That being said I&amp;#x27;d probably modernize the code as I go whenever I touch any part of the codebase.</text></comment>