languages

Commonly used languages in IoT

This post is a part of course From beginner to expert in IoT, so if you’re interested, more information you will find inside the link.

 

Probably you are thinking which language/languages should I choose to start with IoT? It depends. We have general purpose languages that are useful in creating the whole system, from devices to platforms or microservices and ending on the cloud. I chose only general purpose languages to describe. There are many others and writing about everyone is pointless.

How to start with IoT? I described which approaches you can consider starting learning. Everything depends on knowledge which you have at this moment, for me as .NET Developer the best approach is C#, Azure, C/C++ and Python because they are part of the .NET environment. If you are a scientist, you will take into considering Python and C/C++. Beginners should consider JavaScript and Python.

 

C/C++ and Arduino

These languages you should consider when you want to start working with devices. Embedded languages are useful for creating drivers for the devices. One thing to remember, C and C++ are totally different languages, even if C++ has this same syntax as C. C++ support object-oriented programming and generic programming, however, C support structural programming. Arduino is an environment that bases on C/C++ syntax, but extract only useful features from them.

Embedded development has a high entry threshold. You need to have good knowledge of how to use pointers, manually manage memory and other low-level concepts. These languages have one big advantage, are extremely fast, because C designers added access to assembly language inside the code.

 

C# and Java

Both languages are similar, support object-oriented programming. They are working as high-level languages with middle entry threshold. Mostly, used for creating web applications, web services or mobile applications. You can consider these languages if you want to create a system or platform that use or shows data from IoT devices or cloud.

You can use C# in embedded development by creating software on Windows 10 IoT and devices that are able to handle this environment. For example, on Raspberry PI 2/3 you can install Windows 10 IoT and add your own features.

 

Python

Python is an interpreted high-level programming language. It is a very simple language to learn and easy to implement and deploy. Used in Machine Learning to create algorithms. As an embedded language, you can write drivers and software for IoT devices. For beginners Python is the best programming language to start with.

One thing to consider when you want to implement embedded software it’s Python’s performance. Python main goal is deployment speed, however, C/C++ targeting for runtime speed. Sometimes devices don’t have enough memory to use runtime boosters like JIT (Just-In-Time) compiler. Another approach is to use Cython, a framework created for performance that compiles code to C/C++. Cython is a mapper of C functions for Python.

 

JavaScript

JavaScript is another high level, interpreted programming language. Very simple to use for beginners and the most popular language in 2018 based on Stack Overflow’s survey. We can laugh, but the TOP 3 most popular frameworks base on JavaScript.

Most popular frameworks for IoT is Johnny-Five and you can build own microcontroller working on Arduino’s board. For machine learning enthusiast developers created a framework called TensorFlow.js.

 

Conclusion

Which language you will choose depends on you. I’m .NET Developer so I’m working with C# and Azure environment. Additionally, I’m building microcontrollers with C/C++. For experienced developers, C/C++ and one more language to build platforms would be appropriate.

For beginners, Python or JavaScript would be the best choice to start with. If I had to advise something, choose one language, start working with him and after 2 weeks decide, whether it’s the language for you. No? switch to the next one.

You think that I forgot the language that is appropriate for IoT? Leave a comment and I will add it.

Piotr Czech

I am software developer, blogger, mentor, geek, startupper, team leader. I started writing code when I was about 15 years old, creating my first program in C++. I believe that everything can be fixed or changed, by just keep doing small steps each day.

Leave a Reply

Your email address will not be published. Required fields are marked *

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