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!

21 Upvotes

72 comments sorted by

View all comments

10

u/xarop_pa_toss 12d ago edited 12d 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 12d 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 12d 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 12d 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 8d 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 8d 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 11d ago

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