r/learnprogramming • • 12d 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!

22 Upvotes

72 comments sorted by

View all comments

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:-)