(Philosophycal debate) Advise needed - It's not the prgm. language that scares me...

Started by
18 comments, last by Eulagrief 7 years, 2 months ago

BBeck recommends Munificent Bob Nystrom's "Game Programming Patterns". I've read it, I would recommend it, I paid money for it. It's also available to read online for zero (0) dollars / yen / roubles / shiny beads at http://gameprogrammingpatterns.com/

If you need something a step before that then it's time for the feature that we here on Gamedev.net call "I bet Eula recommends that same book" where I say: Allen Downeys Free Book: Learn to Think like a Computer Scientist (C++ Edition) available here: http://greenteapress.com/thinkcpp/index.html

Advertisement

Thank you for the book recommendation you two!

This last recommended book raised my interest thou, not that the first one wouldn't be helpful or useful - I'll be sure to check it later, but it didn't click as fast as this one did.

One questions thou - this book was written in 2012? (I found it on amazon that it was 2009), should this pose a problem, due to the fact that today c++ 2016 has changed in the mean time ? Or most of the principles still would stick ?

Both those books contain a lot of theory, and "solved problems" (for want of a better phrase): The factory pattern works, MVC works, a deque works, maps work - You will need to know what they are, in the same way a mechanic needs to know about cylinders, 4 stroke engines, cooling, braking and the choke. They were all in the early cars, they are just differently implemented today. Same with Factories, MVC,Deque's etc.

Have a look at C++17 new additions. If you dont understand them, JOIN THE CLUB!

Hmmm, I just read through the book a bit and I found this:

"The two sides of a condition operator have to be the same type. You can
only compare ints to ints and doubles to doubles. Unfortunately, at this
point you can’t compare Strings at all!
There is a way to compare Strings,
but we won’t get to it for a couple of chapters."

With today's C++ you can do these things without restriction - this means that this book has indeed some critical discrepancies with today's C++ compiler. In this case I was able to identify the issue, because I already learned and worked with operators and strings - but if I follow this book more down the road, it might lead me into thinking that some things are impossible/not yet implemented in c++ ...

On the other hand, I might use it, as you mentioned, as a programming method/approach book only and try to learn what is universal available in any programming language.

I wrote this post so that it wouldn't mislead other newcomers that would start learning C++ using the above mentioned book.

I would recommend this book https://www.nostarch.com/thinklikeaprogrammer

This book has helped me as I too have the same issues as you, but I've learned a few tricks from the book and it has helped think and approach differently when making projects. The code is written in c++.

Thank you very much sup3rn0va! Especially considering that you took the time to register to help me out. Much appreciated, I'll take a look on the demo chapter and see what I can make out of it.

With today's C++ you can do these things without restriction - this means that this book has indeed some critical discrepancies with today's C++ compiler. In this case I was able to identify the issue, because I already learned and worked with operators and strings - but if I follow this book more down the road, it might lead me into thinking that some things are impossible/not yet implemented in c++ ...

Maybe it will, maybe it won't, but considering you've only just learnt about arrays, have you learnt about vectors? Have you learnt about linked lists? What design patterns have you learnt? They are all good theory, the implementation comes later. You'll be able to rewrite once you learn about new language features.

Or back to the car analogy. It doesn't matter if you learn about brakes on a 1982 car. Just because todays cars have ABS anti-lock brakes, you'll still learn enough to see what's happening.

The alternative is to wait for a brand-new C++17 Teach yourself book, but by the sound of you, you'd rather be doing something, making mistakes and learning by them.

Perhaps you're thinking that free things, things with no cost, also have no value, but that's silly in the Internet Age: but from a cost point of view, lets assume Bjarne Stroustrup's The C++ Programming Language, 4th Edition is $70 new. That only covers up to C++11. The 3rd edition is $5 second hand. Is the 4th edition worth the extra $65 to you now, or will the 3rd edition suffice until you reach a standard where you must know the new features, or the 5th edition comes out covering C++17.

Incidentally can you provide a reference / context for your quote "The two sides of a condition operator have to be the same type. You can only compare ints to ints and doubles to doubles. Unfortunately, at this point you can’t compare Strings at all! There is a way to compare Strings, but we won’t get to it for a couple of chapters.", because it just doesn't feel right? (C++ PL 3rd edition is from 2000, and BS is happily comparing strings)

I've posted something similar in another thread but YouTube has plenty of great talks you can put into practice about design and best practices. Best of all they're free! For example,
Sean Parent C++ seasoning

Basically anything from Sean Parent, Hurb Sutter and Scott Meyers is a good watch and you'll learn heaps

The first part of programming in my mind is knowing the tools that are available to you in the language. You eventually learn the most common tools after you write code that is really gross like the tic tac toe code you posted. Looking back at your code probably made it obvious to you how important arrays and loops can be.

Then, when you know what tools you have, you have to decide what you want to make. That can be a very difficult task if you're not very creative like me.

A suggestion on a small project that I had fun doing when I was still basically a novice programmer, would be making a text based adventure game. I didn't want it just to be text prompts, so I made a map and movement system too. You could definitely do it at your current level of knowledge.

It should output something like this:

----------

-@--------

----------

----------

- = empty tile

@ = player's position

The tile map would be stored in a 2D array. You could have a cin that checks for WASD and changes where you draw the player the next time. Can you think of how you could keep track of that?

Then to answer your last question about left-brained and right-brained people, I think there is something to it, but it can be overcome with enough time. I have gained enough skill in programming that I can have a job in the field, but I am not a natural at it like some of the people I've met. The key to learning something you're naturally bad at is to have a lot of curiosity and have people around to explain things (eventually documentation can replace most of the explanations).

And because tomd1013 is necroposting, he reminded me of Bartek's on-going series of posts about C++17, which readers will find interesting:

http://www.bfilipek.com/2017/02/how-to-stay-sane-with-modern-c.html

In paragraph 1 he complains that v few people read his previous post :

http://www.bfilipek.com/2017/01/cpp17features.html

in which he discusses the new features of C++17. Go on, read it, give him the page views, he's worried about it. Bartek is one of those names that you will come to love and respect.

This topic is closed to new replies.

Advertisement