Is C++ worth the trouble????
I use various forms of polymorphism daily. Not only is there run-time, inheritence based, polymorphism, there is compile-time, template based, polymorphism as well.
---
John Hattan
The Code Zone
Sweet software for a saturnine world
(my byline from the Gamedev Collection series, which I co-edited) John Hattan has been working steadily in the casual game-space since the TRS-80 days and professionally since 1990. After seeing his small-format games turned down for what turned out to be Tandy's last PC release, he took them independent, eventually releasing them as several discount game-packs through a couple of publishers. The packs are actually still available on store-shelves, although you'll need a keen eye to find them nowadays. He continues to work in the casual game-space as an independent developer, largely working on games in Flash for his website, The Code Zone (www.thecodezone.com). His current scheme is to distribute his games virally on various web-portals and widget platforms. In addition, John writes weekly product reviews and blogs (over ten years old) for www.gamedev.net from his home office where he lives with his wife and daughter in their home in the woods near Lake Grapevine in Texas.
Get busy livin'' or get busy dyin''... - Shawshank Redemption
In Java the benefits of OOP is just re-useable code and a more natural design approach.
But the C/C++ thing comes down to a matter of preference. Speaking personally, as someone who programmed in pure C for many years before switching to C++, I've found that programming in C++ using classes, operator overloading, inheritance and polymorphism has made my code easier to understand and more intuitive. There are often times when C++'s inheritance saves me time.
I do however, readily admit that my old style of writing C programs had a lot of room for improvement, mostly because of my lazyness. I guess writing programs using classes just forced me to organise my code better. Properly written C modules can be just as well organised as C++ classes, or so I've been told by reliable sources.
____________________________________________________________
www.elf-stone.com
[edited by - benjamin bunny on August 29, 2002 8:10:08 PM]
____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux
Thanks I think you hit the nail on the head for me. The problem with me and C++ is my design approach. In Java the files are classes so you design around them. e.g. no globals, defines etc... In C++ the file structure is the same as C. Do you know any good resources for learning code structure in C++
Thanks
[edited by - badgerc82 on August 29, 2002 8:10:34 PM]
One catch with C++ when you are learning. C++ was only standardised in 1998. So many of the books out there don't cover the material which was introduced. For the most part C++ was cleaned up with a lot of nice new features. Some of them are templates and containers etc.
Personally, if you're looking for a free option, I would maybe look at Bruce Eckel's books.. http://www.bruceeckel.com
His books are published as a printed book as well, however, he allows you to download a free copy from his website.
Also reading plenty of articles etc on the various websites around etc can always help improve your skills.
Hope this helps.
[edited by - deepdene on August 29, 2002 8:22:27 PM]
quote: Original post by BadgerC82
Benjamin,
Thanks I think you hit the nail on the head for me. The problem with me and C++ is my design approach. In Java the files are classes so you design around them. e.g. no globals, defines etc... In C++ the file structure is the same as C. Do you know any good resources for learning code structure in C++
Thanks
[edited by - badgerc82 on August 29, 2002 8:10:34 PM]
When I am using C++, I structure my files the same way I do in Java. One header/source per class(plus one for winmain in C++).
---
Make it work.
Make it fast.
"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book