View Single Post
  #77   Report Post  
Posted to comp.os.linux.advocacy,alt.os.linux.ubuntu,alt.home.repair
rbowman[_2_] rbowman[_2_] is offline
external usenet poster
 
Posts: 593
Default C++ can be ridiculous, but it doesn't have to be.

On 06/21/2015 10:33 PM, Jeff-Relf.Me wrote:
Likewise, it takes a few minutes to
convert your code from C to C++.


There are a few well known problems, although I can't see a reason to
convert C to C++;

Why move to C++ ?
I like "int &Sq = Me ? MySq : HisSq",
"//" style comments, and declaring variables anywhere.


// and variable declarations anyplace have been supported since C99.
Most compilers have switches to control the pickiness. You can even use
K&R style function definitions if you so desire.

I'd lay part of the problem of some C++ code to the academics. It had
classes so they went out of their way to dream up unlikely ways to use
them, inheritance, and all that good stuff and wound up with
constructors and destructors from hell.

The one thing I do like are the containers even though those were sort
of an afterthought. One of the problems of living through the birth of
C++ is births tend to be messy, with a lot of it being syntactic sugar.

MFC was a quick and dirty attempt to wrap the C Windows API that lasted
well beyond its obsolescence.