Author |
Message |
wtd
|
Posted: Fri Jul 07, 2006 11:56 am Post subject: 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
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
McKenzie
|
|
|
|
|
wtd
|
Posted: Fri Jul 07, 2006 4:05 pm Post subject: (No subject) |
|
|
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
|
Posted: Sat Jul 08, 2006 1:01 pm Post subject: (No subject) |
|
|
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
|
Posted: Sat Jul 08, 2006 1:08 pm Post subject: (No subject) |
|
|
Neither Scheme nor Erlang support such things, yet they're both popular functional programming languages among those who know functional programming. |
|
|
|
|
|
rizzix
|
Posted: Sat Jul 08, 2006 1:12 pm Post subject: (No subject) |
|
|
There are no cons lists in Erlang or Scheme? |
|
|
|
|
|
wtd
|
Posted: Sat Jul 08, 2006 1:13 pm Post subject: (No subject) |
|
|
Yes, they have lists. They do not, however, have user-definable algebraic data types. I thought you were referring to such. |
|
|
|
|
|
wtd
|
Posted: Sat Jul 08, 2006 1:17 pm Post subject: (No subject) |
|
|
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. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
rizzix
|
Posted: Sat Jul 08, 2006 1:19 pm Post subject: (No subject) |
|
|
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
|
Posted: Mon Sep 14, 2009 6:36 am Post subject: 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
|
Posted: Mon Sep 14, 2009 9:55 am Post subject: 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. |
|
|
|
|
|
|