<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Volodymyr Shevchyk</title>
    <description>The latest articles on DEV Community by Volodymyr Shevchyk (@volodymyr_shevchyk_a7061c).</description>
    <link>https://dev.to/volodymyr_shevchyk_a7061c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252305%2F7f86c33f-c0b7-4dee-b7bd-23653116db53.jpg</url>
      <title>DEV Community: Volodymyr Shevchyk</title>
      <link>https://dev.to/volodymyr_shevchyk_a7061c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/volodymyr_shevchyk_a7061c"/>
    <language>en</language>
    <item>
      <title>C or C++ for device firmware? The questions I ask before the language</title>
      <dc:creator>Volodymyr Shevchyk</dc:creator>
      <pubDate>Wed, 18 Nov 2026 16:40:56 +0000</pubDate>
      <link>https://dev.to/volodymyr_shevchyk_a7061c/c-or-c-for-device-firmware-the-questions-i-ask-before-the-language-jlf</link>
      <guid>https://dev.to/volodymyr_shevchyk_a7061c/c-or-c-for-device-firmware-the-questions-i-ask-before-the-language-jlf</guid>
      <description>&lt;p&gt;On almost every new device project someone asks whether the firmware should be in C or C++. I run an engineering company, so I get pulled into this more often than I expected. Over time I stopped treating it as a language question. A few practical things usually decide it before anyone opens an editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What does the vendor SDK expect?
&lt;/h2&gt;

&lt;p&gt;Firmware rarely starts from an empty file. You start with the chip vendor's SDK, an RTOS and their drivers. ESP-IDF, Zephyr and most vendor HALs are C and give you C APIs. You can put C++ on top, but then your team has to be comfortable on both sides of that boundary.&lt;/p&gt;

&lt;p&gt;When the SDK is C and the device logic is small, we usually stay in C. When the logic grows (several sensors, a connectivity state machine, a versioned protocol to the cloud), wrapping the C APIs in a few C++ classes makes the code easier to read and to test.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How big will the code get, and who will maintain it?
&lt;/h2&gt;

&lt;p&gt;The usual objection to C++ on microcontrollers is overhead. In practice it is smaller than people think, and it matters less as the program grows, because in C you end up hand-writing the same abstractions with structs and function pointers. Our blog has a comparison of one LED task written four ways on an Arduino, from flat C to a C++ class: &lt;a href="https://indeema.com/blog/c-vs-cpp-embedded" rel="noopener noreferrer"&gt;C vs C++ for embedded code: differences and a test&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Maintenance worries me more than bytes. A device that stays on the market for five years will be maintained by people who did not write version one. I would rather give them C++ with clear classes and an agreed feature list than C where the structure only exists in naming conventions.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Which C++ features are allowed?
&lt;/h2&gt;

&lt;p&gt;Saying "we use C++" does not tell the team much. On small MCUs we usually switch off exceptions and RTTI, avoid dynamic allocation after start-up and keep an eye on templates that blow up code size. Classes, RAII for peripherals and locks, &lt;code&gt;constexpr&lt;/code&gt;, namespaces and strong types for units tend to pay off.&lt;/p&gt;

&lt;p&gt;If a team can't agree on that list fairly quickly, I take it as a sign to stay in plain C with clean modules for now.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What happens after the device ships?
&lt;/h2&gt;

&lt;p&gt;For a connected product the riskiest code is often the update path: the bootloader, A/B images with rollback, and how the device talks to the cloud when versions differ or the network drops. That part needs careful review and testing on real hardware.&lt;/p&gt;

&lt;p&gt;Bootloaders and the lowest layers usually stay in C because that is what the tooling supports. Above that it can go either way. I mostly care that the update path is designed before the first units leave the lab.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Who is on the team today?
&lt;/h2&gt;

&lt;p&gt;Often the people decide it. A team of strong C engineers will ship a solid product in C sooner than they will learn to write good C++. A team that already writes modern C++ will be slower if you force everything into C.&lt;/p&gt;

&lt;h2&gt;
  
  
  My short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Small device, C SDK, simple logic, C team: C, with clear modules.&lt;/li&gt;
&lt;li&gt;Growing logic, several engineers, years in the field: C++ on top of the C SDK, with an agreed subset.&lt;/li&gt;
&lt;li&gt;In both cases, plan updates and recovery first and get onto real hardware early.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At Indeema we build firmware on ESP32, STM32, Nordic and other platforms, with FreeRTOS, Zephyr and bare metal, and both approaches have worked for us.&lt;/p&gt;

&lt;p&gt;How does your team decide? If you keep a list of allowed C++ features for embedded work, I'd be curious what is on it.&lt;/p&gt;

</description>
      <category>embedded</category>
      <category>c</category>
      <category>cpp</category>
      <category>iot</category>
    </item>
  </channel>
</rss>
