The Case for C++ in the IoT World

by Jun 14, 2018

The Internet of Things or IoT is an extremely popular field in technology right now. With all the new tech that fills so many different consumer demands, the wide variety of choices for programming languages are getting some serious attention and I decided to give a nod to C++.

The Internet of Things is all about the connectivity between you and devices or sensors and the internet. IoT turns modern day appliances and gadgets into reliable data loggers that collect and transmit data to be used as information for analytics or to really just to make our lives easier. IoT fills the role of automating aspects of our lives with embedded sensors and user-friendly software.

Selecting the language you want to use for your IoT projects can be difficult and finding one that provides you with speed and processing power required to run and maintain these devices is nightmarish. So when in doubt, the first language I check out is C++.

C++ in IoT

There are many languages that you can use to develop IoT devices and applications.  C++ ranks in the top 6 of popular choices. C++ is an extension of the C language, known for its’ embedded and low-level project capabilities. A middle-level language with object oriented and generic programming capabilities that allows for low-level memory manipulation. Designed for embedded programming, constrained devices and large systems programming, software built with the language excels in speed, performance and efficiency.


C++ is everywhere we turn. Database software, operating systems, medical applications, and games are just a few examples real world application using C++. As processors have gotten more powerful and the application landscape has taken on additional challenging requirements, C++ has seen an increase in its usage for IoT solutions. C++ provides greater flexibility, with less energy consumption, making it ideal for small devices that can’t maintain high activity levels due to limited power capabilities.

More complex processing tasks than C

Since C++ is “C” with additional features like data abstraction, objects, and classes, this makes C++ a preference for IoT code on Linux systems. Its similarity to C, allows the advantage of using its processing power, making it a great alternative to C when working on complex tasks. These tasks can be devices that serve multiple functions or have multiple sensors, such as thermostats or sensor tags that detect temperature or moisture in their environments.

In fact, many IoT devices available now are actually programmed in C or C++ because these devices don’t have the processing power required to run a lot of higher level languages and most operating systems available for IoT platforms already have support for C or C++.

Embedded Programming – Hardware specific programming

The “Things” in IoT are considered embedded devices or systems. This means that the hardware consists of sensors, modules and so on that are attached to a computer.

While not always the first choice for embedded programming, the modernization of C++ in recent years has seen a rise in its usage.

C++ is great for writing hardware-specific code and it works really well in Linux, which is the number one IoT operating system. C++ is made to handle the hardware and complex processing at the same time, making it ideal for running on embedded systems that have little memory.

What IoT projects are you building with C++?

As for me, I am currently working on a LEGO Mindstorms application. I recently presented on a webinar called Get Kids Coding and was enamored by the amount of toys available to kids that incorporate the Internet of Things. With Bluetooth LE components in C++Builder and a few 3rd party open-source libraries, I can make an app to control my little LEGO robots!

Building IoT solutions requires data to flow between devices, your connected applications, and the internet. C++Builder streamlines your IoT application development by providing easily to use components for Bluetooth, WIFI, and REST communication protocols.