Newbie: The C / C++ Issue
luke at foolishgames.com
Wed Nov 12 18:36:22 PST 2003
On Nov 12, 2003, at 8:37 PM, Marty Leisner wrote:
> BTW -- I've been doing "object oriented" stuff in C for years --
> its harder, but its doable. You have a much simpler language
> to deal with.
> First learn how to write good programs in C.
> Then see if C++ buys you anything extra.
> If it doesn't, you don't need C++.
> But I've seen far too much C++ that's just obscure C.
> Just my experience and opinion.
Am I missing something here? When does C have OO capability? Structs
don't count. What about inheritance and polymorphism?
To me a struct is like a VCR with no record button. You can view the
content, but you can't manipulate it with the struct. If i want to do
something to destroy the tape, I must apply a magnet from an outside
source (much like a plain old function). And classes provide security,
much like the tab on the front of the tape. The data is private if the
tab is puched out. (ok thats a bad analogy)
If C had OO features, then why do we have C++ and Objective C?
I would agree that you can write programs that do the same thing in all
three languages above, but I don't think that OO is a waste of time.
OO promotes code reuse. That is the whole point.
Using C++ implies a state of mind. You can write code like in C, but
it defeats the purpose of using an OO language.
Luke at FoolishGames.com
FoolishGames.com (Jewel Fan Site)
JustJournal.com (Free blogging)
"Only two things are infinite, the universe and human stupidity, and
I'm not sure about the former."
- Albert Einstein (1879-1955)
More information about the freebsd-questions