Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 C++ as a better C?
Index -> Programming, C++ -> C++ Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: 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
Sponsor
sponsor
McKenzie




PostPosted: Fri Jul 07, 2006 2:45 pm   Post subject: (No subject)

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




PostPosted: 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. Smile

I'd call modern C++ style almost closer to functional programming than to procedural or object-oriented.
rizzix




PostPosted: 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




PostPosted: 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. Smile
rizzix




PostPosted: Sat Jul 08, 2006 1:12 pm   Post subject: (No subject)

There are no cons lists in Erlang or Scheme?
wtd




PostPosted: 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




PostPosted: 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
Sponsor
sponsor
rizzix




PostPosted: 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




PostPosted: 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




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: