
-----------------------------------
wtd
Fri Jul 07, 2006 11:56 am

C++ as a better C?
-----------------------------------
I've heard C++ called "C with classes."  This is a mischaracterization.  C++ is a distinct language, and has a lot of other useful improvements over C.

But let's go down that road a bit anyway.  Instead, though, let's avoid talking about objects.  What does C++ still give us?

Templates
Exceptions
Namespaces
References
A stricter type system
Line comments

-----------------------------------
McKenzie
Fri Jul 07, 2006 2:45 pm


-----------------------------------
You're going to have to talk to Bjarne about that one wtd.  I believe he was the one who called it that. 
http://en.wikipedia.org/wiki/C_with_classes

-----------------------------------
wtd
Fri Jul 07, 2006 4:05 pm


-----------------------------------
Perhaps it started that way.  That is by no means where it ended up.  :)

I'd call modern C++ style almost closer to functional programming than to procedural or object-oriented.

-----------------------------------
rizzix
Sat Jul 08, 2006 1:01 pm


-----------------------------------
I disagree. It's much more a procedural/OO than a functional programming langauge. Infact it does not have support for algebraic data types.

-----------------------------------
wtd
Sat Jul 08, 2006 1:08 pm


-----------------------------------
Neither Scheme nor Erlang support such things, yet they're both popular functional programming languages among those who know functional programming.  :)

-----------------------------------
rizzix
Sat Jul 08, 2006 1:12 pm


-----------------------------------
There are no cons lists in Erlang or Scheme?

-----------------------------------
wtd
Sat Jul 08, 2006 1:13 pm


-----------------------------------
Yes, they have lists.  They do not, however, have user-definable algebraic data types.  I thought you were referring to such.

-----------------------------------
wtd
Sat Jul 08, 2006 1:17 pm


-----------------------------------
But we're getting away from the point. Let me just say that C++ is not a fucntional programming language, but expression templates and functors (function objects) permit a functional style of programming.

-----------------------------------
rizzix
Sat Jul 08, 2006 1:19 pm


-----------------------------------
If Scheme is anything like Lisp then it definitely supports algebraic datatypes. It may not be explicit, but it is definitely possible to implement them. After all the cons list is "defined" using lisp itself.

-----------------------------------
stevejack
Mon Sep 14, 2009 6:36 am

Re: C++ as a better C?
-----------------------------------
C++ is an enhanced version of the C language. C++ includes everything that is part of C and adds support for object-oriented programming (OOP). In addition, C++ also contains many improvements and features that make it a ?better C?, independent of object oriented programming. C++ is actually an extensible language since we can define new types in such a way that they act just like the predefined types which are part of the standard language.

-----------------------------------
DemonWasp
Mon Sep 14, 2009 9:55 am

RE:C++ as a better C?
-----------------------------------
Next time, please read the date of the last posted comment: Sat Jul 08, 2006 1:19 pm . We prefer not to "necro-post", meaning reviving any topic that's been dead for over a couple of weeks.
