I’ve never created struct’s before … I’ll look into it … the code you posted looks interesting … but it only amplifies to me, the rigid and limited nature of C … why does C need to be so … ‘rocky’ anyways? And it reeks of 1990’s coding abilities … like it’s not been updated in decades… Is there a reason for that?
The code I posted is C++, not C.
I don’t believe the code I posted is any more rigid than the equivalent Java code. The only difference is that the sizes of the arrays are fixed, which is absolutely a good thing on a microcontroller with 2 KiB of RAM, and not a limitation of the language.
You can of course use dynamic arrays, C++'s “vector<>” is just like Java “ArrayList<>”, but using dynamic memory on devices with little RAM comes with huge caveats.
I have no idea what you mean by “rocky”, but there’s nothing old-fashioned about declaring arrays. How would you do it more “2020-style”?
C++ is updated almost every three years. It’s backwards compatible with older versions, but it’s a modern language.
The latest version is C++20 and will be officially released this year. The compilers that ship with the Arduino IDE right now support up to C++17, but most Arduino boards use C++11 for some reason.
I think Swift might be worse than C when it comes to datatype implementation …
What do you mean by “datatype implementation”? I’m afraid you have some unrealistic expectations of how programming languages should be designed.
it leaves much to be desired in that area especially with object comparison notation … lots of options … and too many of them look the same …
What do you mean by “object comparison notation”? What kind of options?