Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BadgerC82

Is C++ worth the trouble????

This topic is 5804 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all, I''m a C programmer who is now working with Direct x and making some small projects. What I''m interested to know is how many people who program in C++ actually take advantage of Polymorphism and Inheritence and all the OOP (Object - Orientated Programming) stuff in general. I also code in Java at University and that is a totally OOP language so I have to do it there. Is it worth learning the C++ syntax or should I continue to use C with the odd touch of C++. Any comments appreciated

Share this post


Link to post
Share on other sites
Advertisement
Most of the game industry has migrated to C++.

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.

Share this post


Link to post
Share on other sites
i use the c++ features only when they make sense to do so... there tools and you only use the right tools for the job. but use whatever your comfortable with.

Get busy livin'' or get busy dyin''... - Shawshank Redemption

Share this post


Link to post
Share on other sites
I understand that some of the industry has gone over. But I still see advertisements asking for C\C++ so it must still be in use. Is there a performance increase in C++.

In Java the benefits of OOP is just re-useable code and a more natural design approach.

Share this post


Link to post
Share on other sites
The C++ syntax is the Java syntax BTW. You should find it easy to switch from one to the other, as long as you remember that C++ has no built-in garbage collection (ie, delete everything you new ).

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]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
The best way I found to learn any new language is to get a book or two.

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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!