HORUS/blog

Sep 5, 2026 · getting-started · learning-robotics · python · programming-languages

What Programming Language Should You Learn for Robotics First?

Learn Python first: the tutorials, the sensor examples and the drivers all meet you there. C or C++ wins only when your robot is a chip with no operating system.

Learn Python first, ahead of C++ or Rust, because the tutorials, the sensor examples and the beginner path into every robotics framework all start there. Python gets a wheel turning on the evening you begin, and the frameworks a beginner meets, ROS 2 and HORUS among them, treat Python as a first-class language rather than a toy. That flips on a bare microcontroller, where C is the only door in. The rest of this post is for a beginner with no robot yet, deciding what to open tonight and afraid of choosing wrong.

You have a list. Somewhere in a browser tab is a roadmap image with twelve boxes on it, and every box has an arrow into the next one, and somebody in the comments is insisting the whole picture is wrong. Python, C++, C, Rust, MATLAB, a bit of JavaScript for the dashboard, Bash because everything is Linux, and someone always adds Lisp as a joke that might not be a joke.

So you did the sensible thing and started collecting. A course bought in a sale. Another course, because the first one spent three hours on installing an editor. A bookmarked thread of people arguing about whether beginners should ever touch Python. What you have after a month is a syllabus, and what you do not have is anything that moves.

Underneath it sits a specific fear, and it is not about syntax. It is that this first pick compounds — that a year from now you will be the person who learned the wrong thing while everyone else learned the right one, and that the year will not be recoverable.

What programming language should you learn for robotics first?

Learn Python first, unless the robot in front of you is a microcontroller with no operating system, in which case the board has already chosen C. The reason has nothing to do with Python being a better language. A first robot is limited by how many ideas you can try per evening, and Python removes nearly everything standing between an idea and a moving wheel: no build step to configure, an error message that names the line, and a sensor that probably shipped with an example written in Python by the manufacturer. Starting elsewhere means meeting a language, a memory model and a build system at once, before anything twitches, and self-taught beginners overwhelmingly stall in the build system, which teaches them nothing about robots. Now the honest half. A great deal of the control code on working machines is C++, and you will very likely write some. Learning Python first does not cancel that; it changes the order, so that C++ arrives as one new thing rather than four. The head-to-head between those two goes deeper on the split.

What makes a language good for robots in the first place?

A language earns its place on a robot by three things: what hardware it can talk to, whether it can hold a rhythm, and how much borrowed code comes with it. Robot software is not web software with wheels. Your program has to reach a motor driver through a cable, run on a computer far weaker than your laptop, and keep repeating a small piece of work at a steady pace while the world interferes. It also has to be readable in six months by you, who will have forgotten everything. That last point quietly rules out cleverness. Beyond talking to hardware, most of what a robot needs is arithmetic on arrays: angles, distances, camera images, filters. So the language you learn is really a decision about which existing libraries and drivers you can pick up, and how quickly you can change your mind when the robot proves you wrong. What no language decides is whether the machine works. Nobody's robot fails because the mission logic was written in a scripting language.

Which languages are actually used on robots, and by whom?

Six languages cover almost everything on a real machine, and one of your options is deliberately postponing the choice. Python runs behaviour, tools, perception glue and most tutorials. C++ runs control code and nearly every driver on a full computer. C runs microcontrollers. Rust is chosen by people who want a compiler to catch the bugs that crash a machine after hours of running. MicroPython and Arduino sketches are the friendly doors onto small boards. MATLAB and Simulink live in courses and control-theory work. You can also let a framework hand you the language: ROS 2 supports Python and C++ side by side with shared message definitions, so perception can be written in one and control in the other, while HORUS, an open-source real-time middleware for Rust, Python and C++, puts all three languages on the same shared-memory ring buffers so processes on one machine exchange messages without serialising them. Read the rows below as descriptions of people rather than a ranking.

OptionWho it is forWhat it assumes you knowWhen to pick itWhen not to
PythonBeginners and solo builders with a single-board computerHow to install a package and read an error messageYou want something moving this weekThe board runs no operating system at all
C++ on a full computerStudents on a course requiring it, and joiners of C++ teamsCompiling, linking, and where memory comes fromYour class, team or robot already speaks C++You are alone in the evenings with nobody to ask
C on a microcontrollerBuilders whose robot is a board, two motors and a batteryPins, timers, and how to flash firmwareThe robot has a chip and no computerYou want cameras, maps or recorded logs
MicroPython or Arduino sketchesComplete beginners holding their first small boardAlmost nothing beyond copying an exampleYou want the shortest path from wiring to motionA motor must be corrected constantly under load
RustProgrammers who already know one language wellTypes, ownership, and patience with a strict compilerYou want the compiler to catch what crashes robotsThis is the first language you have ever learned
MATLAB or SimulinkStudents and engineers doing control theory properlyMatrices, block diagrams, and your licence termsA course or employer builds controllers this wayYou are funding a hobby robot yourself
ROS 2 with Python and C++Builders who want existing drivers, mapping and navigationLinux, workspaces, launch files and package layoutBorrowed packages are the point of the robotYou need motion before you can face the tooling
HORUSMixed-language builders working on one machineYour message shapes and how your loops are scheduledPython, C++ and Rust parts must share data on one boxThe value of your robot lives in ROS 2 packages

What should you learn if you are coming from web or data work?

Stay in Python and spend your first month on hardware rather than on a language. Someone arriving from data work already owns the single most useful robotics library, because arrays of numbers are what a robot is made of, and someone arriving from web work already knows how to structure a program, read a stack trace and use version control. That is most of the battle. What is genuinely new is not syntax. Physical programs cannot be retried freely: rerunning a script knocks something over. State lives in the world instead of in a database, so your program's idea of where the arm is can quietly stop matching where the arm is. And there is a loop that must not pause, which is a constraint web work never imposes. Resist the temptation to reach for JavaScript because you already know it. The drivers and the numerical libraries are not there, and writing bindings becomes your project instead of your robot. JavaScript does belong on the dashboard you build later, and that is a real and useful job.

What should you learn if all you own is an Arduino and two motors?

Learn the C-flavoured sketch language the board came with, and treat that as real programming, because it is. A microcontroller has no operating system, no package manager and very little memory, so the environment decides most of this for you: the vendor's examples are C, the datasheet talks about registers, and the answers you will find on forums are in the same dialect. Fighting that is a strange hill for a beginner to die on. MicroPython is a legitimate on-ramp rather than a shameful one, and it buys you the thing Python buys everywhere: change a line, reflash, watch the behaviour change, learn what your motors actually do. Where MicroPython stops is predictable — a machine correcting itself constantly against changing load, like anything that balances, will show the interpreter's hesitation as a wobble you can watch across the room. None of this locks you out of anything. Moving to a single-board computer later is a change of environment, not a restart, and the loops and logic come with you.

What should you learn if you want a working robot before the end of term?

Python, and close the roadmap tab today. A deadline is not the moment to learn a build system alongside your own control logic, and term projects are won by robots doing one thing convincingly rather than by well-structured robots doing nothing yet. The sequence that fits a term is narrow: one sensor printing a number, one motor moving, both together, then the behaviour you actually wanted to demonstrate. Everything else is scope you can describe in the write-up as future work, which is what future work means. There is one exception worth stating plainly. If the course grades you on a C++ requirement, or the lab's hardware only has C++ drivers, then the language is decided and your deadline has no vote. In that case the saving is elsewhere: use the lab's existing project as a starting template rather than a blank folder, because on a deadline the build configuration is the part that eats weeks, not the code you write.

What should you learn if you have never written any code at all?

Python, on a laptop, before the robot arrives. This is the one case for making the robot wait a week or two, because learning to program and learning electronics simultaneously means every failure has two possible causes and you cannot separate them. Nothing happened: is the code wrong, the wiring wrong, the motor unpowered, the sensor dead? A beginner cannot answer that, and whole evenings vanish into the question. So spend a short while with variables, loops, functions and reading errors calmly, until a failing program feels ordinary rather than alarming. Choose a tutorial that ends with something happening on screen, and type the examples instead of reading them. Skip the parts that feel like a computer science degree for now: classes, decorators, threading, packaging. None of that is needed to blink a light. Then plug in one sensor and print its number, then one motor, then both. That sequence looks slow and is the fastest route anybody has found.

What do beginners try first, and why does it stall?

Most beginners start a long course in a language they do not yet need, and stall around the third week, when nothing has moved and the material has drifted far from robots. The wall is almost never the syntax. It is the environment: a driver that will not install, a serial port that needs a permission nobody mentioned, a build system with an error message written for somebody else. Reading that error is the actual skill of the first month, and no course teaches it because no course can reproduce your laptop. The second stall is choosing a language from job adverts, which describe teams that already exist rather than beginners who do not. The third is switching languages after a bad evening, which resets the counter and buys nothing, since the next language has its own bad evening waiting. The way out is unglamorous: pick anything defensible, get one motor moving this week, and let the robot start telling you what it needs.

How can you tell whether your problem is the language or something else?

If your program does the right thing but occasionally does it late, the language may be involved; in nearly every other case it is not. Sort the symptom before you sort the tooling. Nothing happens at all, ever: that is wiring, power or a permission, and no language fixes it. The arm reaches consistently to the wrong place: that is maths or calibration, and it will reach to exactly the same wrong place in any language. Readings arrive in bursts, or stop, or are stale by the time you use them: that is a data-flow problem about how your program is structured, not about syntax. The machine works and then hesitates, and adding a print statement changes the behaviour: now you are in language and timing territory, and the fix is usually moving one part into a compiled language rather than rewriting everything. Beginners who skip this triage rewrite a working robot in C++ and find the same bug waiting for them, now harder to read.

What do you give up by starting with Python?

You give up early intuition about what the machine is doing underneath your program, and you pay for it later rather than never. A Python beginner builds a working robot without ever thinking about where memory comes from or how long anything takes, which is a gift on day one and a debt in month six, when the loop starts hesitating and the whole category is unfamiliar. Two costs are less discussed. The first is deployment: Python makes it easy to install dependencies until your laptop and the robot disagree about what is installed, and the day you copy the project to the machine becomes its own small project. The second is habit. Python encourages thinking in whole arrays and whole files, which is the wrong shape for code that must do a little work every cycle for hours. You also give up the smallest hardware outright, because the tiniest chips will not run Python at all. None of this is lost, only deferred, and you pay it back holding a robot instead of a textbook.

When is ROS 2 the better choice?

ROS 2 is the better choice whenever the code you actually want already exists and somebody else wrote it. A robot that must build a map of a building and drive to a goal is a ROS 2 project, because those navigation packages represent years of work you cannot reproduce in evenings. An arm that plans around obstacles is one for the same reason. If the depth camera on your desk has one driver that people trust and that driver ships as a ROS 2 package, the argument is over. Fleets and setups spanning a robot and a workstation are what ROS 2 was designed for, and it is well travelled there. So is joining a lab or a company where everyone already speaks it, because shared vocabulary beats any technical comparison. For a beginner, ROS 2 also shrinks the language question usefully: Python and C++ share the same message definitions, so a node can be rewritten in the other language later without changing how anything else talks. HORUS is not the answer for those projects, and picking it there trades working packages for plumbing you would have to rebuild.

Does the language you learn first decide your career?

No, and here is why: nothing about a first language survives long enough to decide anything. Syntax is the cheapest thing you will ever learn, and a second language costs weeks rather than years once you have written a real program in the first. What compounds is not the language. It is the model in your head of how machines fail — why a correction that arrives late is not a smaller correction but a wrong one, why the same code behaves differently on a cold morning, what a sensor is actually reporting when it reports nothing. That understanding transfers across every language and is most of what separates someone who can fix a robot from someone who can write code. Hiring reflects this more than beginners expect: a candidate who can explain why their arm overshot and what they changed is more persuasive than a candidate with a certificate and no machine, in any language. The career risk is not picking Python. The career risk is spending the year choosing.

Should you learn two languages at once to save time?

Partly, but not the way you think. You will end up using two languages sooner than you expect, and learning them side by side is not how you get there. Studying Python and C++ in parallel means every confusion has two possible sources, and you spend your attention on which language does what rather than on what a robot does. Meanwhile neither one gets far enough to be useful. What actually happens on a working robot is that you learn one language properly, build something, hit a specific part that hesitates, and move that part into a compiled language while everything else stays where it is. That is learning a second language with a reason attached, which is the only version anyone finishes. The exception is narrow and worth naming: reading a second language is much cheaper than writing it, and being able to read the C++ driver you depend on is worth a weekend early on. Reading it is not the same as learning it, and reading is the part that pays immediately.

How do you pick one and stop researching?

Name the thing you want to see happen this month and let that decide, rather than any argument about languages. If the answer is a wheel turning, a servo sweeping, or a camera spotting something, open Python and have it working before the weekend ends. If the answer is a specific board with no operating system, open the vendor's C examples, because the board decided for you. If the answer is a team, a lab or a codebase you want to join, open whatever they write and accept slower evenings for a while. When it stays close, ask one tie-break question: is the hard part of my robot behaviour I have to invent, or timing I have to hold? Invented behaviour favours the language you can iterate in fastest. Held timing favours the language that does the same thing every cycle. And if you are heading towards machines that take spoken instructions, the roadmap for putting a language model on a robot starts in Python too.

Decide by situation rather than by preference:

When the framework question arrives later, weigh the candidates on the five axes of the HORUS Fit Framework — ecosystem size, setup effort, team size fit, deployment target and licence — and take the option that loses on the fewest, with no scores and no numbers involved. If your project ends up on one machine with a Python layer, a C++ layer and a growing suspicion that the boundary between them is eating your evenings, star HORUS on GitHub so it is in your list when you start building.

Found this useful? Share it:Discuss on HNShare on X