News for hackers. Stuff that matters.
Re:C++ confessions of a C developer by ArkyBeagle on Sunday December 04, 2016 @12:02PM (#13100604)
There is nothing specifically wrong with C++ en toto. What's happened is that historically, it was perceived as a leverage tool to make larger, more ambitious projects attainable. What I saw of that was that the failure rate went up.

So my memory is that C++ is mildly "worse is better" than was C.

I think the failure rate went up because:

   - more people got drawn into programming. Some of them 
     got dumped there; many people with whom I worked were 
     actually, say aeronautical engineers who were told 
     that they had to pivot to software to keep their job. 

   - people think of the radius of software when thinking
     of size, when the real measure is the surface area 
     of a sphere implied by that radius.

   - Us old guys got to learn C on smaller projects which 
     were actually deployed, so we had the benefit of 
     going through the full cycle, playing all the roles.

   - You can easily run into ctors/dtors problems when
     decomposing C++ projects into modules. 

   - Preventing integration problems between modules just
     requires a lot of good interpersonal communications 
     and sometimes, C++ gets in the way. 

   and most insidious of all

   - New language systems are devilishly hard to embrace in
     environments which are intended to be competitive. 
One thing I've learned is - expressive power is 100% about what the expectations of the reader are. I find differential equations more expressive than English for those things where they are appropriate, but that's because I trod a different path. With C++, the expressive power is because the reader unpacks more information per symbol-suite. Just realize that that is not the same for everyone.
Re:C++ confessions of a C developer by minipci1321 on Sunday December 04, 2016 @01:52PM (#13101180)
> With C++, the expressive power is because the reader unpacks more information per symbol-suite. Just realize that that is not the same for everyone.

Then reducing the expressive power of a language will only make this worse, not better. To make code to speak to a random reader, one needs to carefully select idioms (from the professional domain, not the language's ones) he/she wants to implements, and if new/unfamiliar ones need to be introduced, make sure they are clean and easy to grasp. Removing features from the language makes this harder.

Funnily enough, people frequently illustrate their point with exceptions, whereas in my league of a single feature contributing the most to code readability, exceptions compete for #1 position! They are easy to grasp __conceptually__ for a C programmer, and when properly used, make code much easier to read. They also create a feeling of confidence when dealing with code (as they cannot be missed, contrary to error signalling via return values). Etc.

Re:C++ confessions of a C developer by ArkyBeagle on Sunday December 04, 2016 @05:12PM (#13102054)
I would not consider exceptions a significant improvement in C, in general. I might make allowance for using them for division, signed integer math where overflow is a possibility or in cases for memory overwrite when possible.

IMO, exceptions ( and I use them A Heck Of A Lot, probably to a fault in coding Tcl ) are really just a convoluted control flow mechanism, and I'd rather see the expectations made explicit than exceptional.

Heck, with full-on MMU memory protection, all code that's not in kernel mode should be free of memory overwrites anwyay. I say that as a maintainer.