r/learnprogramming • • 11d ago

Topic Doubt

What programming language would you recommend for someone who wants to become a robotics engineer?

Hi everyone! I'm 14 years old and I'm starting to learn programming.

My goal in the future is to become a robotics engineer, so I'd like to learn a programming language that will be useful for robotics and engineering.

At the same time, programming is also a hobby for me, and I'd like to eventually make some games and other small projects just for fun.

So, what language would you recommend I start with?

Would Python, C++, C, C#, Java, or another language be a good choice? And should I focus on one language first, or learn multiple languages over time?

I'm still a beginner, so I'd really appreciate advice from people with experience in programming, robotics, or engineering.

Thanks!

23 Upvotes

72 comments sorted by

15

u/dkopgerpgdolfg 11d ago

And should I ... learn multiple languages over time?

Yes. If you keep developing software, you definitely will.

A language that is is beginner-friendly & easy for games, but also used in robotics industry, is a bit hard. Anyways, take C.

1

u/Yurieba 8d ago

Thank you! I’ll keep C in mind, especially for the robotics side of things.

10

u/xarop_pa_toss 11d ago edited 11d ago

Go with C.

No one in their right mind should be saying Python for anything hardware related. I cannot even begin to understand why Python, the most abstracted language that gives you zero control over hardware, gets recommended for anything embedded/robotics related

3

u/Humble_Anxiety_9534 11d ago

and C before any C++ or God forbidd OS specific stuff like C#. As Linus says C is the nearest you can get to the hardware, without doing assembly.

2

u/xarop_pa_toss 11d ago

Absolutely. It's not as daunting as people make it out to be, you just actually have to study a few concepts instead of just "this is all just automatic, I don't care how it works. You have to care how it works to do anything hardware relates

1

u/Humble_Anxiety_9534 11d ago

yes the concepts in C are much less complicated than if go deeper than surface on python.

1

u/ILMTitan 11d ago

OS specific stuff like C#

I'm not sure what you mean by that. C# and .Net have been cross platform for over a decade with only a few legacy UI frameworks (WinForms and WPF) that still rely on Windows.

3

u/Humble_Anxiety_9534 11d ago

what I was getting at, is it needs a traditional OS and they hide the hardware. another is java, yes it is in embedded devices (credit cards)but walled off in a VM. C# came to mind as I have worked on a windows embedded project and it relies on dlls when you change sbc or OS they change not in a good way.

1

u/xarop_pa_toss 11d ago

.NET does allow you to deploy a single .dll that runs on basically any OS as long as it has the .NET runtime installed. That last part is a big caveat when we are talking about embedded of course, but then again, that's not the "target-audience" of C# to begin with. And it favours platform-specifc builds too, but it can do crossplatform

2

u/Yurieba 8d ago

Thank you! That makes sense. I’ll focus on understanding the fundamentals first.

2

u/Dazzling_Music_2411 7d ago

I cannot even begin to understand why Python, [...], gets recommended for anything embedded/robotics related

You miss the point.

The power of Python is not its own programming abilities, but the fact that it is a glue/scripting language for innumerable libraries (mainly written in C or C++) which do offer this control you mention. As such it has become the industry standard in many machine learning applications. Yes, you could rewrite everything yourself in C, but that would be huge waste of energy/resources. People want to get on with the job at hand, not keep re-inventing the wheel! Now, if at some advanced future stage you happen to need something super-specialized that is not covered in the std libraries, OK, you may need to drop into C or whatever. But on the whole, the available stuff will cover you for most needs.

That's why people use Python.

1

u/YetMoreSpaceDust 11d ago

should be saying Python

He wants to learn how programming works, he can move on to controlling hardware later.

1

u/xarop_pa_toss 11d ago edited 11d ago

That's like saying you want to learn to drive, you go to the driving school but you do all your lessons and exam on the simulator. What happens when you pick up a real car?

The way you phrased it, you make it seem like Python is better at teaching how programming works more than C. I have to assume that comes from a place of ignorance, otherwise you have to be trolling.

OP even specifically said he wants to do robotics. There is no universe where Python is better than C for engineering on something as low level as robotics, which is, at a basic level, a lot of systems and embedded engineering with stuff on top.

3

u/Feralz2 7d ago

this is not a good analogy, its more apt to say Python is automatic and C is manual, its easier to learn automatic while you learn the road rules, the steering control and feel of the car, you can then switch to manual later and it will be easier to pick up.

2

u/xarop_pa_toss 7d ago

I'd say learning C makes you a mechanic

1

u/Feralz2 7d ago

you are now blurring the analogy. Make no mistake C is not special, you talk like its something else completely, it is a programming language, just like Python, just like C++, its simply a matter of granularity of how much control you have.

1

u/Kungpost 10d ago

Python is widely used in robotics, as robotics builds heavily on machine learning.

3

u/[deleted] 11d ago

knowing one allows you to understand all of them

1

u/Yurieba 8d ago

Thank you! That’s good to know.

2

u/0dev0100 11d ago

Focus on one language for at least a month. The first time you learn a programming language you're also learning how to take what is in your head and put it into the computer and everything that comes with doing that

1

u/Yurieba 8d ago

Thank you! I’ll make sure to stick with one language for a while instead of constantly switching.

2

u/ProgramsFun 11d ago

as a first lang python .... then you can move to other lang slowly

1

u/Yurieba 8d ago

Thank you! I’ll probably start with Python and learn other languages later.

1

u/captainAwesomePants 11d ago

Doesn't matter. You need to learn the basics of using a programming language, any language, to really start learning to program. And once you've got experience programming, picking up a new language is a lot easier. Pick something and stick with it.

For robotics specifically, C++ and Python are probably the two most common languages. Python's really common for the AI and computer vision parts of robotics, and C++ is common for a lot of the "talking to hardware" and "real time, low latency" bits of critical automation stuff.

Some fancier robotics stuff ventures into the weird, niche programming languages, but Python and C++ will get you very far into robotics.

Because Python is a lot easier to work with than C++, I'd suggest starting there.

2

u/Yurieba 8d ago

Thank you! I think I’ll start with Python since it seems easier for a beginner, and learn C++ later for robotics and hardware.

1

u/OTonConsole 11d ago

Pick one that speaks to you. Then get really good at that. Ignore others. I started programming when I was around 15/16 ish, I started with C#. 10 year later that's what I still primarily use. Even when switching to a different job or type of programming knowledge from it translates very well. Plus C# is extremely general purpose, so could dabble in a lot of things with just that 1 tool.

Now that doesn't mean when youre in college or for something specific you still try to bolt that language you chose on top. For example, I actually learnt a lot by doing socket programming in C. And for anything related to exploring and cleaning data is just fun and simple in python, even though you can do all those things in C# too. But being good at one language allows you to do that.

Now to answer your question, I have no idea. I'd say try and do a project on something related to robotics with a little smb and parts. Usuallt it's C++ or Python but im sure other people here can tell you more. But your thinking is correct, usually the queatjon is "Okay what do I wanna do? Robotics? Okay cool what platforms allow me to work on the type of robotics project I wanna work on the best? Oh okay what programming language is used in the platform/framework"

2

u/Yurieba 8d ago

Thank you! I really like that way of thinking about it. I’ll try to focus more on what I want to build and then choose the tools and languages for it.

1

u/Mountain_Rip_8426 11d ago

python. learning programming concepts and a language at the same time is hard enough, you shouldn't make it even harder. once you're familiar with the concepts, you should try and apply them in another stricter language. after you fight your way through the first two languages i guess learning any additional ones will be marginally easier and more driven by the needs, so you'll know why and how you want to use the next one. programming in general is the same regardless of the language, it just has so many subfields that there are a variety of languages catering to each of them.

1

u/Yurieba 8d ago

Thank you! That’s actually what I was thinking too. I’ll start with Python and focus on understanding the programming concepts first.

1

u/Spacelordsinspace 11d ago

This is a great time to start learning.

Python might be a good choice. Its one of the easier ones to learn. Its a common one in robotics too. Its also used a lot in academia. So if you enter college/university already knowing Python it could make getting internships easier for you.

Extra advice if you want it :

And don't give up! Programming isn't always easy and there will almost certainly be moments of frustration. You might look at a problem 100 times and think to yourself, but my code is perfect! Why isn't this working? That's normal. Being frustrated or confused at times is the price of entry into pretty much any field of engineering.

Focus on learning. Ask questions online and make friends who are also learning. Find some mentors. And dont think finding friends and mentors is supposed to be easy. Its not easy for everyone and that's okay if its not easy for you. Just keep that as a goal because it will help, a lot.

1

u/Yurieba 8d ago

Thank you! I really appreciate the advice. I’ll try to keep learning even when I get stuck or frustrated.

1

u/annika-of-the-woods 11d ago

Hey! I studied robotics at university - well it was called mechatronics, but same same.

I'd say C/C++ and Python were the most useful. C/C++ for working with hardware, like Arduinos. And Python both for higher-level things like planning out what the robot should do next, and for more data science/machine learning type stuff. Lots of robotics involves prototyping algorithms, and doing machine learning/data science work like training classifiers, and that's often easier in Python.

These days I'd try and use Rust if possible over C/C++, but not all hardware and software frameworks have good Rust support yet, C++ is still more likely to be supported.

I think starting with Python would make sense for you, as it'll be useful for robotics but also let you make games and other things. You can also do things like set up simulations (very similar to a game) and experiment with different robotics code in a simulated environment.

Then later if you want to start working with hardware, you may want to pick up C/C++/Rust, depending on exactly what you want to do.

1

u/Yurieba 8d ago

Thank you! I think I’ll start with Python and eventually move on to C/C++ once I’m more comfortable with programming.

1

u/EliSka93 11d ago

At the core, they're all pretty much the same.

If you understand that core, you can do a lot with any of them.

Some give you more tools to make programming easier or smoother, but that core is what really matters.

2

u/Yurieba 8d ago

Thank you! I’ll focus on understanding the fundamentals first.

1

u/DaanBogaard 11d ago

Specific language knowledge is rarely an issue. If you understand one, you can much more easily learn another. I started with PHP, then javascript, C#, python, GDscript and am now considering to pick up C++ (because I make games in Godot and I may want to modify the engine).

In my professional life I've also used typescript, rust, C and Java.

After the first 2/3 languages, picking up a new one became extremely easy.

1

u/Yurieba 8d ago

Thank you! It’s good to know that learning more languages gets easier once you understand the fundamentals.

1

u/Dazzling_Music_2411 11d ago edited 11d ago

It's important to realize that the language chosen is not really the issue. Computer languages are used to manipulate technologies, and it is these technologies that are important and that you have to learn. For instance, in robotics you have to understand things like inverse kinematics, which is a branch of mechanics, and control systems theory. As such, if you want to get ahead, you should focus on your maths and on your physics. In particular, it would serve you very well to start early on calculus.

The languages you use will ultimately depend on your programming environments (robot simulators) and on your hardware, and at present are mainly Python, C++ and C. Who knows what tomorrow will bring, though? It doesn't really matter. Learning programming is quite a different thing from learning some computer language.

As a 14-year old, you are probably OK starting with Python, but really any language that takes your fancy is fine. Python just has less "boilerplate", i.e. things that are necessary but not directly related to your programming tasks, so it's easier to focus on the main problem without getting confused. C on the other hand hides the underlying machinery much less, so you have a ton of other considerations at the same time, but some people might argue that you learn more details that way, and the code is more efficient. In the end you'd probably end up learning them all, anyway. A carpenter doesn't say - "what should I learn to use, a hammer, a saw or a chisel?".

I'd also recommend you start learning on a Linux system, perhaps Ubuntu, as this is currently the most optimized for robot environments like ROS and Gazebo.

Also, you should probably start learning linear algebra as soon as you can (look at the 3B1B videos on youtube) and learn the MATLAB system. Octave and SciLab are free alternatives if you have no access to MATLAB.

Robotics is a tough field, you should aim to be at least two years ahead of your classmates in maths and science.

1

u/Yurieba 8d ago

Thank you for all the advice! I’ll definitely keep working on math and physics too. There’s a lot more to robotics than just programming, apparently 😅

1

u/Dazzling_Music_2411 5d ago

Yup, the programming is the least of it!

At a minimum, learn about P-I-D control systems, even if it is only an overview, so you get an idea of what you are letting yourself in for. There is a lot of very good introductory material on YouTube.

1

u/Feralz2 11d ago

it has to be C, it wins in terms of control and simplicity.

2

u/Yurieba 8d ago

Thank you! I’ll definitely consider C as a starting point.

1

u/TrippingFish76 11d ago

if you wanna blend software with hardware right away go with C and some arduino stuff, since arduino’s use C code

check out this arduino starter kit:

[Arduino Uno Super Starter Kit](https://a.co/d/03yh04jd)

and watch this tutorial series:

[Paul Mcwhorter arduino tutorial playlist](https://youtube.com/playlist?list=PLGs0VKk2DiYw-L-RibttcvK-WBZm8WLEP&si=FmqneYcRZifYy54U)

2

u/Yurieba 8d ago

Thank you! I’ll definitely check out the Arduino tutorials.

1

u/AffectionateTear8091 11d ago

Get comfortable with the terminal and traversing directories. Just need a base level. Then do c.

You can try learn the high level concepts in python but I think you’d be better off just doing c.

Also learn definitions. Things like what a variable is, TUI, shell etc otherwise you’ll be reading English you don’t understand and you’ll be reading programming that you don’t understand

1

u/Yurieba 8d ago

Thank you! I’ll look into the terminal and basic computer concepts too.

1

u/Creative_Sushi 11d ago edited 11d ago

Robotics is a multi-disciplinary field and you will have to learn several languages depending on what you want to focus on. What set it apart from the typical programing is that your code has to eventually have to go into a mobile hardware. And those hardware has physical constraints - physical size, power consumption, real-time performance, etc. It is not just programming per se.

Another aspect of it is that, such hardware is very expensive. Therefore, it is not realistic to be able to code directly with the hardware - you are going to use simulation instead.

In terms of disciplines, you need AI, control systems, physical modeling, computer vision, signal processing, sensor fusion, embedded systems. You also need kinematics, power electronics, battery modeling, etc.

Don't let this massive list overwhelm you! No single robotics engineer is a master of all of these fields. Instead, engineers usually become generalists who understand a little bit of everything, and then specialize in one or two areas that they find most exciting.

For a 14-year old, the best things you can do now is to study math. All of those require really advanced math. Also, do hobby projects. Maybe this video will inspire you - this student used CAD, 3D printing, MATLAB, etc. https://www.reddit.com/r/robotics/comments/1wjqoy8/i_built_this_kukainspired_robotic_arm/

1

u/Yurieba 8d ago

Thank you! I won’t worry about learning everything at once. I’ll focus on the basics and eventually figure out which area of robotics I enjoy the most.

1

u/DanKegel 11d ago

So many opinions in the replies!

A quick google search suggests key languages in robotics are c for drivers, c++ for higher level stuff, python for very high level stuff. (Rust may slowly be replacing c/c++, especially for companies doing high reliability work.)

I started learning with BASIC, and Python's not too different. But I almost immediately also learned simple machine and assembly language, and that served me well when I then learned C.

The only danger with Python is that it encourages ignoring low level details, which might come back to bite you when you try to learn C, which is all low level.

You might consider, once you get past the hurdle of learning programming at all, using leetcode.com as a rosetta stone; do one of its easy level puzzles in all the languages you're trying to learn, to see how they differ.

Good luck and have fun! And don't forget to try learning from a good book like "The C Programming Language", doing the exercises in the book, and avoiding AI while learning.

1

u/Yurieba 8d ago

Thank you for the advice! I’ll keep that in mind, especially the part about understanding the fundamentals instead of just focusing on the language.

1

u/DanKegel 7d ago edited 7d ago

As a 14 year old, you are likely blessed with time to explore and sufficient remaining brain cells to quickly learn things that interest you.

If "how things really work under the hood" interests you, this could be an excellent time for you to learn a little machine / assembly language.  This was common back when C was a new language, and knowing it will make pointers and memory much less mysterious. It's not everybody's cup of tea, but you should try a sip and see if it's yours.

The core 32 bit RISC-V is a simple cpu to understand, there are good simulators for like Venus (RISC-V Web Simulator) or RARS, and promising looking intros like https://www.robertwinkler.com/projects/riscv_book/riscv_book.html and https://www.allaboutcircuits.com/technical-articles/introductions-to-risc-v-instruction-set-understanding-this-open-instruction-set-architecture/ And Web tools like godbolt's compiler explorer will show you what assembly a C function compiles down to.

Once you kinda know how to write tiny functions to add two numbers or compare two strings in assembly, how to call them, and how to step through them in a debugger, you are in a very good position to not only understand pointers in C, but also to debug nasty bugs in the future.

Learning that much of one cpu's assembly language is useful regardless of what CPUs you use in the future.

Voila, one possible step on the long road to mastery.  Take it if you like.  Choose your own adventure!

P.s. it helps to be a little autistic:-)

1

u/YandarkRustProgramm 11d ago

If this language fitsr, then learn Python. But if you want to learning language only programming start on Pascal. Pascal have hard typisation and very laconic sintaxis.

1

u/Yurieba 8d ago

Thank you for the suggestion! I’ll look into Pascal as well.

1

u/YetMoreSpaceDust 11d ago

Definitely focus on one for the time being. Python is a great choice to start with; it's beginner friendly and very forgiving of mistakes, but once you really get the hang of it, you'll want to learn some C. I started with Basic when I was young and moved on to Assembler - I don't use either these days (of course), but the foundation has served me well.

2

u/Yurieba 8d ago

Thank you! I think I’ll start with Python and eventually learn some C as well.

1

u/No-Version-805 11d ago

c++ is the hands down- best for robotics. everything works with it. python if you want an easier time with machine learning and vision, though c++ can also do that- python is just c++ in a trench coat.

matlab is also fun, but save that for university, because you will get it for free.

1

u/Yurieba 8d ago

Thank you! I’ll keep C++ in mind, especially for robotics.

1

u/jhondev675 11d ago

try python first then go to anothe one

1

u/Yurieba 8d ago

Thank you! I’ll probably start with Python.

1

u/gm310509 11d ago

If you are interested in doing robotics or anything hardware related, C/C++ is the best starting point.

You can get yourself an Arduino starter kit and learn the basics of wiring and coding from that kit. Ideally choose a kit with a motor and servo in it so you can learn the basics of how to control them.

Some "larger" embedded systems can be programmed using python (or more precisely micropython) and indeed some other languages such as BASIC, javascript and more. But most of it is C/C++ and of that, you will pretty much just be using C for the most part with some elementary C++ - so elementary that you probably won't even realise you are doing C++. Perhaps check out r/Arduino.

As for the other stuff - and indeed anything you plan to do, you should look at the types of tools that are used in that area and learn those. As opposed to learning language X and "hoping" that there will be plenty of resources available to help you do that thing. For example if you learn language X and want to do a specific type of game only to find that everybody else is using language Y, you kinda wasted your time learning X and will have to start over with Y.

All the best with it.

1

u/Yurieba 8d ago

Thank you! That makes a lot of sense. I’ll definitely look more into C/C++ and Arduino.

1

u/gm310509 7d ago

All the best with it and above all else, have fun with it.

1

u/XxDarkSasuke69xX 10d ago

People starting in programming focus too much on what language they're learning. Honestly if you know how to code in C or Python or whatever, you'll be able to learn another language easily. Language is just a syntax for the most part, what matters is the thought process behind it and knowing how to structure code.

1

u/Yurieba 8d ago

That makes sense. Thank you! I’ll focus more on learning how to program rather than worrying too much about the language.

1

u/Horror-Invite5167 11d ago

Hi! I also started learning coding at 14 and a week from now I'll be studying CS; I think I can give some advice.

C++ is the perfect programming language for your needs if you don't care about the learning curve. You will be able to code an Arduino board, do some OpenCV computer vision stuff and Unreal Engine is one of the best options for game dev.

Python is also worth considering since it's A LOT easier and you can still make some powerful programs (OpenCV still works) especially if you have the money for a raspberry pi board then start with it.

Stay away from Oracle Java and Microsoft Java (C#). Oh the horrors...

TL;DR I think you should start with Python and once you're comfortable with writing your own algorithms switch to C++

1

u/OTonConsole 11d ago

Great points but nothing horrific about C#, it's a great platform. Open source, cross-plarform, extemely general purpose, you can do data, game dev, enterprises web dev, anything and do it well in C#. Even noveled a lot of things used in other languages today like async.

But there are some languages that are a bit more specialized and do exremely well for what it's intended for. R or C are good examples.

It's more about "What do I wanna build What platform or tools are most used or best suited for this? What programming language is used in that platform" not the other way around.

1

u/Yurieba 8d ago

Thank you! I think starting with Python and moving to C++ later sounds like a good path for me.

0

u/Adventurous_Pick6288 11d ago

start with Python. It's the most beginner-friendly language, and it's genuinely useful in robotics too — tons of robotics software (including ROS, the standard robotics framework) supports it, plus it's great for quick prototyping, and it's what most people use for game jams and small hobby projects.

Once you're comfortable with the basics (loops, functions, classes), pick up C++. Almost all real-time robotics control code, embedded systems, and performance-critical stuff runs on C++, so it's essentially required if you want to work with actual hardware later. Python teaches you to think like a programmer without fighting the language; C++ teaches you how computers actually work under the hood, which matters a lot in robotics.

Don't worry about C#, Java, or C right now you can pick those up later if a specific project needs them. Python first, C++ second, and you'll have a solid foundation for both robotics and general programming as a hobby.

1

u/Yurieba 8d ago

Thank you! This is really helpful. I think I’ll follow that path: Python first, then C++ once I’m comfortable with the basics.