C++ learning for beginners
Author
Discussion

moustachebandit

Original Poster:

1,336 posts

173 months

Saturday 11th December 2021
quotequote all
My nephew - like many kids is into games, but has expressed more than a passing interest in coding, so I thought I would buy him a book to encourage him.

From my limited knowledge C++ is the main language for games, but struggling to find a suitable book for beginners thats appropriate for an 14 year old. Everything seems to either be aimed at kids (and childish) or adults.

Does anyone have some suggestions?

Thanks

xeny

5,501 posts

108 months

Saturday 11th December 2021
quotequote all
I'd consider starting with Python, not C++. Probably a more broadly applicable skill, and less of a learning curve. Job prospects are probably no worse than C++ see https://www.northeastern.edu/graduate/blog/most-po... for example.

moustachebandit

Original Poster:

1,336 posts

173 months

Saturday 11th December 2021
quotequote all
Thanks for the response.

I was also looking at Python as well, but thought that due to his interest in games C++ might be more relevant to his interests.

Found a possible catch all languages book that might be a good starting point and seems well rated.

https://www.amazon.co.uk/gp/product/B09LGY96L8/ref...

devnull

3,869 posts

187 months

Saturday 11th December 2021
quotequote all
The important thing here is not to 'learn C++' but learn to code - two different things. Once you know coding concepts, then you can apply then to any language.

As above, my recommendation thesedays is to do a course on Python to learn those concepts. Python takes a lot of C++ concepts and abstracts them a little to make things a bit easier to comprehend. There is also a metric ton of courses free and otherwise available to tinker with Python. Just look here on Udemy, all the courses are about £15.

Myself and my friends all did C++ as one of the modules in Uni, but they all do Python for their jobs thesedays (along with a lot of the sysops stuff to talk to python apps - web front ends, databases etc).

TonyRPH

13,546 posts

198 months

Saturday 11th December 2021
quotequote all
Arduino coding uses a (watered down) version of C++

Learning to program hardware like the Arduino teaches a lot of basic concepts, and although the C++ is slightly watered down, the basic concepts are still there, and can easily be transferred across to 'full fat' C++.

I think it can be a good starting point.



camel_landy

5,512 posts

213 months

Saturday 11th December 2021
quotequote all
devnull said:
The important thing here is not to 'learn C++' but learn to code - two different things. Once you know coding concepts, then you can apply then to any language.
^^^ This...

...and then you can understand why it should be ++C. hehe

M

jesusbuiltmycar

5,135 posts

284 months

Saturday 11th December 2021
quotequote all
xeny said:
I'd consider starting with Python, not C++. Probably a more broadly applicable skill, and less of a learning curve. Job prospects are probably no worse than C++ see https://www.northeastern.edu/graduate/blog/most-po... for example.
I would go along with this - Python and C++ are both "multi-paradigm" languages and learning good coding skills and techniques is probably more important when starting out. the skills learnt programming Python (including design patterns) can be transferred to any language, making learning new languages a lot easier. Learning C++ as a first language could prove very frustrating and un-rewarding and I would imagine your nephew will quickly get bored.

For Python I would possible start with YouTube as there are many python courses available...

Now a days C and C++ are mainly used for systems programming, banking, embedded devices and game engine development. For gaming the lower level engine will probably be coded in C/C++ (for speed) but a lot of the UI aspects of the game will be programmed in another language (e.g. Java, C# etc). The C++ aspects of the gaming engine will generally be very mathematical (e.g. https://en.wikipedia.org/wiki/Fast_inverse_square_...

Programs written in C++ are generally very fast but that comes at a cost in learning difficulty - C++ is one of the most difficult languages to learn because the programmer needs to carefully take care of resource management. Other languages (e.g. C# Java, Swift, Python) manage memory and resources for the programmer - C++ has no "garbage collector". As a language C++ is evolving - since the C++11 update many of the older nastier gotcha's in the language can be avoided but they are still present. The latest version is C++20 and in the last 10 years the latest Standard (C++20).


colin79666

2,224 posts

143 months

Saturday 11th December 2021
quotequote all
If he has a Mac take a look at Swift.

grumbledoak

32,571 posts

263 months

Saturday 11th December 2021
quotequote all
C++ is not a great starting point these days. Probably never was.

He could start with Roblox in Lua
https://education.roblox.com/en-us/resources/intro...

or Unity and C#
https://unity.com/how-to/learning-c-sharp-unity-be...

Both are much more modern, higher level languages than C++, and the tutorials will be games programming with pretty good progression.


tribbles

4,171 posts

252 months

Saturday 11th December 2021
quotequote all
camel_landy said:
^^^ This...

...and then you can understand why it should be ++C. hehe

M
In some schools of thought, it should be "P"...

smile

dcb

6,068 posts

295 months

Saturday 11th December 2021
quotequote all
xeny said:
I'd consider starting with Python, not C++.
+1

Learning to drive by using a Ferrari would be the wrong way to do it.

Java is a possible other solution. The advantage of Java is that you
can draw pretty pictures easily, without getting bogged down in
manual - and very fiddly - object management.

I note with interest that the C++ folks keep themselves busy
with frequent standards (1998, 2003, 2011, 2014, 2017, 2020).

I think I'm right in saying that they never take a feature out, leading
to language bloat, which the original language designer has acknowledged.

jesusbuiltmycar

5,135 posts

284 months

Sunday 12th December 2021
quotequote all
dcb said:
xeny said:
I'd consider starting with Python, not C++.
+1

Learning to drive by using a Ferrari would be the wrong way to do it.

Java is a possible other solution. The advantage of Java is that you
can draw pretty pictures easily, without getting bogged down in
manual - and very fiddly - object management.

I note with interest that the C++ folks keep themselves busy
with frequent standards (1998, 2003, 2011, 2014, 2017, 2020).

I think I'm right in saying that they never take a feature out, leading
to language bloat, which the original language designer has acknowledged.
You pretty much are correct - some things are eventually removed from the language but it takes a long time. The C++ Standardisation Committee are painfully aware that there is a fast amount of C++ systems code out so backwards compatibility is a must - if the followed the routes of some of the younger languages new standards would not be adopted; even with this in mind plenty of companies are scared of adapting - mainly because the engineers are happy 'just turning the cog' and are not motivated to learn anything new...

Python2.x reached end of life about a year ago, and this was announced at least 10 years ago - some companies are till using Python2.x for the majority of their code!!!


CrouchingWayne

749 posts

206 months

Sunday 12th December 2021
quotequote all
grumbledoak said:
C++ is not a great starting point these days. Probably never was.

He could start with Roblox in Lua
https://education.roblox.com/en-us/resources/intro...

or Unity and C#
https://unity.com/how-to/learning-c-sharp-unity-be...

Both are much more modern, higher level languages than C++, and the tutorials will be games programming with pretty good progression.
Unity has some great tutorials as well

biggiles

2,173 posts

255 months

Monday 13th December 2021
quotequote all
Don't go for C++.

If they're really keen and able, then go for Python. A good intro book is "Computer Coding Python Games for Kids" by Carol Vorderman (yes, she).

Otherwise, go for Scratch first, then move up to Python. Scratch teaches the principles well and while as a purist I would prefer Python, for children (even 14) it's a much better place to start learning.

djneils98

341 posts

180 months

Monday 13th December 2021
quotequote all
I teach computer science at A level
C++ for a young beginner (unless they have an exceptional aptitude) is a not the best I would suggest
There are many options if he wants to get into games coding:

Python and libraries like pygame
C# and Unity game engine
Javascript and game libraries like Kaboom or Phaser

moustachebandit

Original Poster:

1,336 posts

173 months

Monday 13th December 2021
quotequote all
Just wanted to say a massive thanks to everyone thats contributed to this - its been really helpful. As suggested I will bin off the C++ idea and focus on python and check out the suggested titles. Might buy myself a book whilst I am at it too!

moustachebandit

Original Poster:

1,336 posts

173 months

Monday 13th December 2021
quotequote all
grumbledoak said:
C++ is not a great starting point these days. Probably never was.

He could start with Roblox in Lua
https://education.roblox.com/en-us/resources/intro...

or Unity and C#
https://unity.com/how-to/learning-c-sharp-unity-be...

Both are much more modern, higher level languages than C++, and the tutorials will be games programming with pretty good progression.
Thanks for the suggestion - I didn't know there was an education library for Roblox, but I know he is on that a lot, so will also point him in that direction. That could really be up his street. Especially if he can create something his friends can play.