• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
stein102

having a hard time learning C++

19 posts in this topic

I come from a java background, and am honestly having the hardest time learning C++. I'm using the tutorial at learncpp.com and I find that I'm not retaining most of the information I've read. Everything seems so weird in C++ as opposed to java which I find to be very straight forward. C++ feels all jumbled and messed up, and I can't do a lot of the things I can do in Java (or haven't learned how to do it yet).

 

I feel like I have to invest a lot of time just to learn how to do something that should be really simple, such as inheritance (which I found really easy in Java).

 

I just want to get to the same level I was in Java, but this task is a lot more daunting than I originally assumed.

 

Any tips?

0

Share this post


Link to post
Share on other sites

I come from a java background, and am honestly having the hardest time learning C++. I'm using the tutorial at learncpp.com and I find that I'm not retaining most of the information I've read. Everything seems so weird in C++ as opposed to java which I find to be very straight forward. C++ feels all jumbled and messed up, and I can't do a lot of the things I can do in Java (or haven't learned how to do it yet).

 

I feel like I have to invest a lot of time just to learn how to do something that should be really simple, such as inheritance (which I found really easy in Java).

 

I just want to get to the same level I was in Java, but this task is a lot more daunting than I originally assumed.

 

Any tips?

 

I recommend Bruce Eckel's free-to-download "Thinking in C++" books. Great content, good explanations - deep enough to clarify but not enough to lose focus - and good exercises. Sure, a bit old, but all code works (I ran most examples and solved most exercises with gcc and clang) and it won't stop you from learning C++11 after you've mastered the basics - actually, it will provide you with a solid base for C++11. Read Vol. 1 and do all exercises. Worth every second you spend on it.

+1

I also came from a java background and  found it easy learning from that book

If you aren't already, use an ide like code::blocks. It will make your life easier

0

Share this post


Link to post
Share on other sites

Any tips?

 

Do projects instead of just coding aimlessly. That will work.

 

"C++ feels all jumbled and messed up"
 

Maybe it feels that way but its not:)

0

Share this post


Link to post
Share on other sites

Please don't use this [thenewboston] as your only source to learn C++ from as he leaves out information in his tutorials especially around the inheritance, virtual functions and polymorphism section.

He doesn't just leave out information, he's also outright incorrect at points.  A lot of beginners seem to find TheNewBoston's videos valuable and easy to follow, and so I've always taken the stance that I won't outright recommend not using them -- but you should definitely be using other resources as well to correct any mistakes and fill in the blanks.

 

 

Like the above, I would strongly recommend more practice -- things will stick with you once you're actually using them.  It can be frustrating moving from an easier language to something lower-level where you aren't able to do the same things as easily, but you'll get it if you persist. smile.png

0

Share this post


Link to post
Share on other sites

I'm surprised nobody mentioned The Famous C++ FAQ - http://www.parashift.com/c++-faq/

 

Over the years, I fond it to be an invaluable resource to refresh the knowledge (before an Interview) and connect all dots - with only a few lines/paragraphs of text (instead of 10 pages in some book).

 

Once you can answer all those questions, it will mean that you understand the design and implementation of the language, and you will be a master of C++  - of course, for that level of knowledge, you will need to go through many books - Design Patterns, STL, Template Metaprogramming, ...

 

I'm not sure I'd recommend Bruce Eckel's Thinking in C++ at this early stage, though. It's a pretty heavy read that is best to enjoy once you have a basic grasp on the most basic low-level C++ concepts like pointers, virtual methods and templates (and no, Java exp. doesn't really count here).

 

And that's before we even touch the subject of C++11....

2

Share this post


Link to post
Share on other sites

I mostly used Cplusplus.com to learn C++ but I could already program at the time and was only interested in learning the syntax. Good thing about that site is it shows the way C++11 does things as well. I would start learning the basics of C++11 as well because "auto" (C# "var") and ranged for will make most of the crazy STL iterator stuff go away for you and it will seem more like C# or Java.

 

 

I'm surprised nobody mentioned The Famous C++ FAQ - http://www.parashift.com/c++-faq/

 

Over the years, I fond it to be an invaluable resource to refresh the knowledge (before an Interview) and connect all dots - with only a few lines/paragraphs of text (instead of 10 pages in some book).

 

Once you can answer all those questions, it will mean that you understand the design and implementation of the language, and you will be a master of C++  - of course, for that level of knowledge, you will need to go through many books - Design Patterns, STL, Template Metaprogramming, ...

 

I'm not sure I'd recommend Bruce Eckel's Thinking in C++ at this early stage, though. It's a pretty heavy read that is best to enjoy once you have a basic grasp on the most basic low-level C++ concepts like pointers, virtual methods and templates (and no, Java exp. doesn't really count here).

 

And that's before we even touch the subject of C++11....

 

As I mentioned before there are a few things in C++11 that make the langauge easier to use for people who are coming from higher abstraction layers, sadly not all the features are implemented in all compilers yet. GCC is currently mostly there and so is Clang I think. But the ranged for(foreach) and auto keywords are definitely something C# and Java programmer will understand and be able to harness.

Edited by NightCreature83
0

Share this post


Link to post
Share on other sites

Well, we've had the basic for_each for about a decade (perhaps slightly less) in C++, available from <algorithm>

That's probably an area I'd recommend anyone [coming from a managed language] to start.

 

I'm still not convinced C++11 makes things much easier for people coming from managed languages. Half of those concepts must seem pretty alien...

 

I still think one has to learn C++ bottom up - you do need to tear a bunch of hair here and there to truly appreciate things like Smart Pointers, STL data structures (over regular arrays), STL algorithms, ....

 

It's usually only then that the design choices of the language designers click

0

Share this post


Link to post
Share on other sites

Most of the stuff in algorithm sadly require you to know about functors and function pointers to make them work effectively, using a lambda on those is actually a lot nicer then either of the previous one (see http://nwcpp.org/static/talks/2011/lambda.pdf).

 

But we are getting off topic here, the only way as mentioned before to really learn C++ is by shooting yourself in the foot repeatedly and learning from those mistakes, and C++ makes it easy to shoot yourself in the foot. So as a beginner I would stay away from anything that is intermediate level at the beginning and write code that just runs on the stack to begin with as you would in Java and C#. The heap is not hard to manage but object life time will come in to play when using the heap lots, as you need to manage the allocation on the heap as well as the deallocation of your objects in it.

0

Share this post


Link to post
Share on other sites

I'm using the tutorial ... and I find that I'm not retaining most of the information I've read.

 

I think that's your problem right there.

IMO, attempting to learn C++ using a tutorial is a 100%-sure recipe for confusion and failure.

Given that you're also going to have to un-learn what you've seen in most on-line tutorials on C++ (they usually follow egregiously bad coding practices), it's worse than a waste of time, it's a negative use of time.

 

Instead, I'd recommend you work through one of the books suggested here: http://isocpp.org/get-started

Note that "work through" is meant in the active sense -- in particular, as others mentioned, you must do the coding exercises, simply reading the book is not sufficient.

 

See also:

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

 

More people in your situation (with relevant advice):

http://stackoverflow.com/questions/403431/switching-from-java-to-c-whats-the-easy-way

http://www.reddit.com/r/gamedev/comments/1b62qt/moving_from_c_to_c_having_already_knowledge_of_oo/

http://www.reddit.com/r/cpp/comments/zpigl/refreshing_c/
http://www.reddit.com/r/cpp/comments/ks4yd/learning_c_as_a_java_user_starting_with_the_snake/c2muazn
http://www.reddit.com/r/cpp/comments/hxc1f/can_anyone_suggest_a_good_book_to_help_with_the/
http://www.reddit.com/r/cpp/comments/12f3bl/which_book_is_best_to_learn_c/
 

Edited by Matt-D
1

Share this post


Link to post
Share on other sites

I come from a java background, and am honestly having the hardest time learning C++. I'm using the tutorial at learncpp.com and I find that I'm not retaining most of the information I've read. Everything seems so weird in C++ as opposed to java which I find to be very straight forward. C++ feels all jumbled and messed up, and I can't do a lot of the things I can do in Java (or haven't learned how to do it yet).

What kinds of things can you not do?

I feel like I have to invest a lot of time just to learn how to do something that should be really simple, such as inheritance (which I found really easy in Java).

There is nothing simple about inheritance. But still, I don't think C++ makes it particularly hard.

I just want to get to the same level I was in Java, but this task is a lot more daunting than I originally assumed.

Any tips?

C++ is a confusing language. I failed to learn it on my own a couple of times. On my third attempt I was actually using it at work, where we have a local guru, and I succeeded. Don't get me wrong: After 11 years using C++ daily, there are still dark corners of the language that I don't understand, but I know to stay away from them. ;)

Anyway, as others have said, you need to do a lot of coding in C++ to get good at it. Feel free to post in these forums with more specific questions about difficulties you may encounter. Edited by Álvaro
0

Share this post


Link to post
Share on other sites

The good thing about C++ [from the learning standpoint] is that it is incredibly unforgiving [especially compared to a managed runtime like C# / Java] and makes it very easy to mess things up.

 

Which is a good thing, since the long-term memory and coding reflexes are best initialized by spending hours in a debugger / stackoverflow / msdn and not by a single short exercise that works the first time you try it out.

 

 

As a kid, did you listen to your parents to not touch the Hot Iron on the Ironing board or did you rather learn by burning your hand smile.png  ?

0

Share this post


Link to post
Share on other sites

I'm surprised nobody mentioned The Famous C++ FAQ - http://www.parashift.com/c++-faq/

 

Over the years, I fond it to be an invaluable resource to refresh the knowledge (before an Interview) and connect all dots - with only a few lines/paragraphs of text (instead of 10 pages in some book).

 

Once you can answer all those questions, it will mean that you understand the design and implementation of the language, and you will be a master of C++  - of course, for that level of knowledge, you will need to go through many books - Design Patterns, STL, Template Metaprogramming, ...

 

I'm not sure I'd recommend Bruce Eckel's Thinking in C++ at this early stage, though. It's a pretty heavy read that is best to enjoy once you have a basic grasp on the most basic low-level C++ concepts like pointers, virtual methods and templates (and no, Java exp. doesn't really count here).

 

And that's before we even touch the subject of C++11....

http://yosefk.com/c++fqa/

 

My tip: Leave C++ and never look back. It's pure evil.

0

Share this post


Link to post
Share on other sites
&nbsp;

I recommend Bruce Eckel's free-to-download "Thinking in C++" books. Great content, good explanations - deep enough to clarify but not enough to lose focus - and good exercises. Sure, a bit old, but all code works (I ran most examples and solved most exercises with gcc and clang) and it won't stop you from learning C++11 after you've mastered the basics - actually, it will provide you with a solid base for C++11. Read Vol. 1 and do all exercises. Worth every second you spend on it.

&nbsp;

It WAS a good book, but C++ has progressed and now it is a good book about an obsolete language that shouldn't be used. There are, of course, common roots, but why learn (and unlearn) old and unpleasant techniques along with the complex enough current state of C++?

A random example of how modern C++ has removed syntactic and conceptual cruft:
http://herbsutter.com/2013/05/09/gotw-1-solution/
1

Share this post


Link to post
Share on other sites

I think C++ is a great language. You can do so many neat memory management tricks with C++ than with Java or .NET. It is also a true work horse if you get your code right. For me, understanding how memory layout and memory management works in C++, helped a lot learning C++ language. I think it is also quite cool that when you work with C++ you'll get to know how memory management works in OS and you surely get know difference between stack and heap memory and what are pros and cons per each.

 

When you learn all these, moving then to some more higher level language is quite easy. It is good to know, that even if you are using Java or .NET same C/C++ things happens under the hood. I think it is kind of language what gives to you quite a lot of. It takes time to learn, but I think it's totally worth of.

 

Altough I hate header file comments when working with std-library. It's so cryptic, I'll have to say that. Fortunately in cplusplus.com std-library is documented quite well.

 

This is not perhaps best example, but I found it really cool that how easy it is to corrupt stack with C standard methods and run method from the stack with buffer overflow attack. That kind of things just open your eyes. It was a practice what we did in school.

0

Share this post


Link to post
Share on other sites
Actually C++ is an abstraction over the memory management system of the OS, which itself is an abstraction over the actual hardware. That's the first time I've heard the fragility and insecurity of C++ as a plus point!


To the OP, if you got the language basics down, try the tutorial in my sig. It covers a lot of C++ concepts, but with real non trivial code.

This is why I hate most book samples, it's hard to grok something when all the examples are so abstract.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0