Learning to code - Python followed by C++
Discussion
Hi all,
Having recently found myself with a bit of extra time on an evening, I've decided to make a serious effort at learning to code, primarily for embedded software on devices (C/C++). Reading around the subject (and keeping in mind I'm basically an absolute beginner) it was recommended that I learn Python to get the basics and then jump into C.
I was wondering if anyone has any good resources for a newbie, at the moment I'm following this syllabus for Python, https://www.notion.so/4f0d76b4b6b54c88a4c99d665018... but I'm open to suggestions!
Thanks
Pete
Having recently found myself with a bit of extra time on an evening, I've decided to make a serious effort at learning to code, primarily for embedded software on devices (C/C++). Reading around the subject (and keeping in mind I'm basically an absolute beginner) it was recommended that I learn Python to get the basics and then jump into C.
I was wondering if anyone has any good resources for a newbie, at the moment I'm following this syllabus for Python, https://www.notion.so/4f0d76b4b6b54c88a4c99d665018... but I'm open to suggestions!
Thanks
Pete
toohuge said:
Good luck! Embedded programming is fun .... until it isn’t 
W3 schools is excellent imo - there’s loads of YouTube videos too. The key is practice , practice , practice.
Haha, thankyou. By profession I'm an Instrument Engineer specialising in safety systems (measurement of pressure, temperature etc.) so I'm familiar with the devices but not necessarily what goes on inside. I've applied for a job working on the certification of these products and obviously the embedded software validation is quite a big part and having at least an understanding of the software I think will help hugely. Also, being an engineer I tend to problem solve quite a lot so I'm hoping I can apply that.
W3 schools is excellent imo - there’s loads of YouTube videos too. The key is practice , practice , practice.
Its still very early days, but quite enjoyable so far!
By all means try Python just to get a feel for programming, but the differences might hinder you when you move to C++. Tooling, variable typing, memory management, even concurrency, even stuff like white space vs curly brackets.
I can’t recommend anything specific but there are probably undergrad level courses for C++ that assume only mathematical knowledge and will get you off on the right foot.
Then go back and learn Python and it will seem easy
I can’t recommend anything specific but there are probably undergrad level courses for C++ that assume only mathematical knowledge and will get you off on the right foot.
Then go back and learn Python and it will seem easy

essayer said:
By all means try Python just to get a feel for programming, but the differences might hinder you when you move to C++. Tooling, variable typing, memory management, even concurrency, even stuff like white space vs curly brackets.
I can’t recommend anything specific but there are probably undergrad level courses for C++ that assume only mathematical knowledge and will get you off on the right foot.
Then go back and learn Python and it will seem easy
Haha, thanks for the recommendation. Already getting a nice warm feeling over C++ I can’t recommend anything specific but there are probably undergrad level courses for C++ that assume only mathematical knowledge and will get you off on the right foot.
Then go back and learn Python and it will seem easy


There's a few online python courses on this site - none on C++ unfortunately.
https://www.futurelearn.com/search?q=python
https://www.futurelearn.com/search?q=python
Pete102 said:
essayer said:
Straight to C++. Skip Python
I've also read this a couple of times. Can you elaborate more as to why?If you are targeting small scale embedded devices (such as sensors, iot devices etc.) they will probably be based around microcontrollers - some engineers would recommend using ‘C’ and not C++..
On the other hand Python is an interpreted language and will be more resource hungry. That said Python is a lot easier to program and is a great teaching language - it is a great way to learn good practices, especially if you couple it with a tool called PyLint which will recommend ways to improve/correct the code you have written.
For C++ there are some great YouTube channels and the language is being constantly improved - most modern compilers will support the C++17 standard and would advise you to use a the C++12 standard as a minimum.
For Python use Python 3 - the older version (Python 2.7 is now obsolete).
Will you be programming on Windows, MacOS or Linux?
jesusbuiltmycar said:
The reasoning is C++ is a compiled language and runs natively in embedded systems - this means it is more efficient, in terms of speed, resource requirements and program size..
If you are targeting small scale embedded devices (such as sensors, iot devices etc.) they will probably be based around microcontrollers - some engineers would recommend using ‘C’ and not C++..
On the other hand Python is an interpreted language and will be more resource hungry. That said Python is a lot easier to program and is a great teaching language - it is a great way to learn good practices, especially if you couple it with a tool called PyLint which will recommend ways to improve/correct the code you have written.
For C++ there are some great YouTube channels and the language is being constantly improved - most modern compilers will support the C++17 standard and would advise you to use a the C++12 standard as a minimum.
For Python use Python 3 - the older version (Python 2.7 is now obsolete).
Will you be programming on Windows, MacOS or Linux?
Lots of new information for me already, I appreciate it. If you are targeting small scale embedded devices (such as sensors, iot devices etc.) they will probably be based around microcontrollers - some engineers would recommend using ‘C’ and not C++..
On the other hand Python is an interpreted language and will be more resource hungry. That said Python is a lot easier to program and is a great teaching language - it is a great way to learn good practices, especially if you couple it with a tool called PyLint which will recommend ways to improve/correct the code you have written.
For C++ there are some great YouTube channels and the language is being constantly improved - most modern compilers will support the C++17 standard and would advise you to use a the C++12 standard as a minimum.
For Python use Python 3 - the older version (Python 2.7 is now obsolete).
Will you be programming on Windows, MacOS or Linux?
I'll be programming on Windows.
For C++ most Windows programmers use Visual Studio (or Visual Studio Code) which also have good Python support.
It may be worth setting up git with a free but bucket account so that you can keep different versions of programmes you write - which can be really useful when learning (it is another tool to learn though).
For learning any new language it is good to have a problem to solve/goal to write a program for - reading books articles will only get you part of the way there.
For the experimenting with embedded programming it may be worth getting something like this and looking at some of the projects suggested online:
https://thepihut.com/products/arduino-uno-rev-3?va...
(I have only used one for a job interview test)
It may be worth setting up git with a free but bucket account so that you can keep different versions of programmes you write - which can be really useful when learning (it is another tool to learn though).
For learning any new language it is good to have a problem to solve/goal to write a program for - reading books articles will only get you part of the way there.
For the experimenting with embedded programming it may be worth getting something like this and looking at some of the projects suggested online:
https://thepihut.com/products/arduino-uno-rev-3?va...
(I have only used one for a job interview test)
Mmm, I've been thinking about this. As mentioned, I'm not sure Python is a good step to C or C++ as in many ways, Python is designed to relax or ignore the rules of something like C.
It really depends what you want to learn.
Python (like Perl) is an efficient language for solving quite a lot of real world problems. It take some syntactic shortcuts to make that easier. You don't have to worry too much about the underlying hardware, memory etc.
C is a layer or two above machine language where there is an inherent knowledge of the underlying memory that your program is manipulating.
C++ is an object oriented verson of C.
If you *want* to learn C or C++, I would start with C or C++.
It really depends what you want to learn.
Python (like Perl) is an efficient language for solving quite a lot of real world problems. It take some syntactic shortcuts to make that easier. You don't have to worry too much about the underlying hardware, memory etc.
C is a layer or two above machine language where there is an inherent knowledge of the underlying memory that your program is manipulating.
C++ is an object oriented verson of C.
If you *want* to learn C or C++, I would start with C or C++.
I thnk that understanding C / C++ gives you a much better idea of how computers actually work (in procedural languages at least). That grounding makes it easier to then think about Java, Python or Perl.
Once you master that, you can lean functional languages like Miranda or Haskell :-)
Once you master that, you can lean functional languages like Miranda or Haskell :-)
It depends on your project, but the C++ based Arduino platform is easy to learn with plenty of support and libraries.
Normally for a project I use the Arduino to get the functions and interrupts working, and if I need more speed or control will translate the program to C, or assembly as an absolute last resort.
Normally for a project I use the Arduino to get the functions and interrupts working, and if I need more speed or control will translate the program to C, or assembly as an absolute last resort.
CharlesElliott said:
The C++ Programming Language (Stroustrup) the same for C++. C++ Primer (Lippman et al) is also good.
This are good for reference only and not up to date so I would avoid them.For learning try something like. ‘A Tour of C++’ by Bjarne Stroustup or “C++ Crash Course” by Josh Lospinoso - modern C++ is a very different language to the C++ of 10 years ago.
https://www.amazon.co.uk/Crash-Course-Joshua-Alfre...
Edited by jesusbuiltmycar on Thursday 28th January 22:36
The answer depends on what you want to do. Perhaps you could give a few more details.
Micropython runs very nicely on many microcontrollers - including the ESP32 and the new Raspberry Pi Pico is great place to start - https://www.youtube.com/watch?v=yzsEr2QCGPw
C++ is good too, but -imho- the Arduino IDE is outdated and lacks many modern conveniences - command completion, debugging for instance. Compilation is also really slow. The C++ used is a subset of the language.
Other IDEs are available but seem less used.
The new Raspberry Pico is so cheap that you should probably buy a few and compare development environments to see which you prefer. They will probably influence your enjoyment and productivity more than the language itself
Micropython runs very nicely on many microcontrollers - including the ESP32 and the new Raspberry Pi Pico is great place to start - https://www.youtube.com/watch?v=yzsEr2QCGPw
C++ is good too, but -imho- the Arduino IDE is outdated and lacks many modern conveniences - command completion, debugging for instance. Compilation is also really slow. The C++ used is a subset of the language.
Other IDEs are available but seem less used.
The new Raspberry Pico is so cheap that you should probably buy a few and compare development environments to see which you prefer. They will probably influence your enjoyment and productivity more than the language itself
Genuinely very happy at all of the responses from you all, so thankyou.
At the moment I don't have a clear idea of what exactly I want to do, the idea of taking a program and turning it into a small device (using Arduino for example) really appeals to me at a hobby level. I also have a couple of ideas for programs I want to create as projects to learn with but at the moment my interest is purely driven by a desire to know more about software / embedded software.
Currently working through this Youtube video https://www.youtube.com/watch?v=vLnPwxZdW4Y, super basic (and thus perfect for me!), once I've done that I'll start looking for a book / syllabus to follow.
At the moment I don't have a clear idea of what exactly I want to do, the idea of taking a program and turning it into a small device (using Arduino for example) really appeals to me at a hobby level. I also have a couple of ideas for programs I want to create as projects to learn with but at the moment my interest is purely driven by a desire to know more about software / embedded software.
Currently working through this Youtube video https://www.youtube.com/watch?v=vLnPwxZdW4Y, super basic (and thus perfect for me!), once I've done that I'll start looking for a book / syllabus to follow.
The Arduino language is a lot like C anyway. C rather than C++ tends to be preferred for embedded work for historical reasons - it is "closer to the metal" and inherently less abstracted than C++, and more efficient on resources. You get more of a feeling of directly controlling things rather than a virtual machine hidden under the software. Obviously, in recent years the Raspberry Pi etc have made comparatively huge computing horsepower and memory space much more accessible for little money, and they have made C++ and other more languages that are comparatively "wasteful" of resources like Python, much more feasible to use. Either way, learn one and you will have a big start on learning the other.
Despite being an embedded software engineer (well, for about 10% of my work) using C and assembler, I get the feeling that I should have learned Python a long time ago. It is comparatively quick to hack things together in Python - like in the old days with BBC BASIC etc. More and more work seems to be requiring it rather than "proper" languages (that's me being a programming snob). To an extent software engineering is going out of the window, and hacked together software (made by "coders" rather than programmers or software engineers) is becoming the norm, with Python becoming increasingly popular, not least because it gets taught a lot! A bit of a virtuous circle there.
K&R and Stoustrup may be the bible for C/C++, but they are bloody awful for learning how to program!
Despite being an embedded software engineer (well, for about 10% of my work) using C and assembler, I get the feeling that I should have learned Python a long time ago. It is comparatively quick to hack things together in Python - like in the old days with BBC BASIC etc. More and more work seems to be requiring it rather than "proper" languages (that's me being a programming snob). To an extent software engineering is going out of the window, and hacked together software (made by "coders" rather than programmers or software engineers) is becoming the norm, with Python becoming increasingly popular, not least because it gets taught a lot! A bit of a virtuous circle there.
K&R and Stoustrup may be the bible for C/C++, but they are bloody awful for learning how to program!
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


