Programming Languages

We can’t program embedded systems without a programming language (or twelve).

Table of Contents:

  1. Common Languages
  2. How Many Do I Need?
  3. Techniques for Learning Programming Languages
  4. Common Languages
  5. How Many Do I Need?
  6. Techniques for Learning Programming Languages

Common Languages

Here are languages that embedded systems developers will typically encounter or use:

  • C, currently the most widely used language for firmware development
  • C++, which provides many benefits over C, although some language features are not often suitable for microcontrollers
  • Rust, which is gaining popularity due to its focus on memory safety and safer concurrency
  • Ada, which a niche language used primarily by the U.S. Department of Defense and for safety-critical systems
  • ARM Assembly
  • RISC Assembly

Here are scripting languages that are useful for embedded systems developers to learn:

Here are data exchange languages that are commonly used with embedded systems:

Here are other languages that a developer should be familiar with:

  • Markdown is a commonly used documentation markup language
    • We use Markdown to write our blog posts, to create Field Atlas entries, and to build documentation in our source repositories
  • Restructured Text is another common markup language. It is more complex, but also more powerful than Markdown.
  • TLA+ is a formal specification language that is used for modeling the behavior of systems and algorithms. This is a great aid in verifying software designs.

How Many Do I Need?

The short answer is: you can never know enough languages! Every language is a different tool that is designed for a different purpose. Sometimes, one tool will be more applicable to a given situation than another.

If you’re just getting started, we recommend developing competency with a primary programming language that can be used for firmware development, such as C, C++, or Rust. Become familiar with Python, which is used for scripting and prototyping on your personal computer. Learn about the data exchange languages – even if you don’t need them right away, you will eventually need to transmit or receive data using one of these common exchange formats.

We recommend learning at least one new language every year, even just to the point of basic familiarity. Every language you learn will stretch your mind in a new way. You’ll be exposed to different ways of thinking and different program design techniques. You’ll find new tools to add to your toolkit. Best of all: you’ll gain the confidence that you can keep up with our quickly evolving technological world.

Often, your favorite tool will still work for most situations, even though it’s not the best tool for a particular job. This can lead us into complacency, thinking that we don’t need to master other languages. Avoid that trap and challenge yourself to learn new languages regularly.

Techniques for Learning Programming Languages

For basic advice, we recommend focusing on the core language in your initial exploration. Avoid frameworks and libraries until you’ve mastered use of the language. You want to focus on the fundamentals, and then apply them to increasingly complex problems and situations.

Whenever you’re learning a new programming language, there is no substitute for practice using the language. Reading a book or website about a programming language will introduce you to the concepts, but you will not cement them into your memory without writing real code using the language.

Try to apply your new language to a problem you’re interested in solving. Maybe you need to automate something on your computer. Maybe you want to build a web page that shows live data updates from an air sensor in your house. Maybe you need to build a calculator so you can solve your chemistry homework much faster. Whatever the language or problem, you can find a way to turn it into an interesting programming challenge.

You can also work through programming challenges in your target programming language using services like Cyber Dojo or HackerRank.

Once you are comfortable with the language syntax and fundamental uses, you should take a look at the source code for popular projects and frameworks in your language. You want to be exposed to a variety of programming styles within the language. By reviewing code, you will see new techniques and use cases that you would have never thought of otherwise.

You can cement the programming language concepts in your mind by building your own cheatsheets and notes on using the language. These should not be straight copies of something you’ve found on the Internet. Instead, they should be produced from memory and tailored to what you have trouble remembering most. The simple act of clarifying a concept in a small section of writing will often help you overcome learning and memory roadblocks.

If you really want to master the language, try teaching it to someone else. You can write blog posts, answer questions on Stack Overflow, or create presentations that you can deliver to your colleagues over a lunch-and-learn session. Similar to creating your own cheat sheets, the act of distilling the information in a way that you can teach it to others (as well as the pressure of teaching!) will cement the ideas in your mind.

Share Your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.