3 ms·
Embedded devices really opened my eyes to this world. What a fool I was using malloc on my first Arduino project.
by gorgoiler 4y ago
Embedded devices really opened my eyes to this world. What a fool I was using malloc on my first Arduino project.
- jcelerier 4y agoArduino is entirely C++ though
- lelanthran 4y ago> Arduino is entirely C++ though No, it's C++ without exceptions (so constructors are useless). On Arduino you will almost certainly program in a C-with-classes manner; lack of exceptions make almost everything that C++ brings to the table useless[1].
- jandrewrogers 4y agoIt is remarkable how many large and modern C++ code bases somehow make thorough use of the language, including constructors, without exceptions. Unless the asserted need for exceptions is a gross mischaracterization.
- jcelerier 4y ago> lack of exceptions make almost everything that C++ brings to the table useless[1]. sorry what ? constexpr (https://github.com/arduino-libraries/Arduino_EdgeControl/blob/48858179293228a84c323184be7c148303d2e81f/examples/Basic/0-5V_Input/0-5V_Input.ino https://github.com/arduino-libraries/Arduino_EdgeControl/blo...), templates (https://github.com/arduino-libraries/Temboo/blob/dcce3007eb5158d9360fd56531e7d8d22b3c5f5c/src/utility/MQTTClient.h https://github.com/arduino-libraries/Temboo/blob/dcce3007eb5...), etc. are all widely used in the Arduino community. I've recently done some work involving C++20 coroutines on an RP2040. etc etc... And even without exceptions, RAII can still help ensuring a large amount of invariants automatically.