Technically programming languages are different languages.
They have syntax, grammar rules and semantics.
(Or do you mean different to what you’ve seen other people write?)
TL;DR: It's C++ with parts written in a C style.
From what I gather (though I’ve never seen anything that outright confirms this) they started out with C and then moved over to using C++, but a lot of the people who contributed to Arduino knew more about C than C++, so the result is a lot of C++ code written in more of a C style.
The things I can say for definite are:
- Arduino code is compiled as C++
- There are ways to intermix C with the C++, but the Arduino library itself requires C++
- Arduino code relies on an implementation of the C standard library (for targets with AVR chips, it’s avr-libc), not the C++ standard library
.ino files are translated behind the scenes into a
.cpp file, so if you’re using a standard Arduino setup then there will always be C++ involved.
I’ve never properly learnt C so I wouldn’t even class myself as a C programmer.
Or to put it another way, I do not write C code.
I learnt C++ in a desktop environment so I stick fairly close to ‘proper’ C++, but with a few concessions made because of the restrictions of an AVR environment. E.g. I avoid
virtual functions and consequently I rarely have need for inheritance.
These days I tend to stay away from the term ‘object oriented programming’ for a number of reasons.
Should I take that to mean that you don’t know what
For more info on
this, have a look here:
Technically it’s not required because the compiler can figure out when you’re referring to an object member, but I prefer to try to always use
this-> because it makes it clear which functions/variables are members of the object.
The main reason I started always using
this-> is because there have been times when I’ve seen code snippets (that don’t use
this->) taken out of context and it’s not apparent from the snippet alone whether a variable is a member variable or a global variable, and the difference can be important.
A nice side effect is that the appearance of
this is less jarring in those rare occasions where it’s actually compulsory.
The other reason I prefer
this-> is because I don’t like naming styles that mandate giving member variables a special prefix like
m_. It feels like reinventing the wheel to me. (The wheel being
I’m not sure ‘dumb it down’ is a fair way to phrase it since you still need to be fairly intelligent to do even basic programming (unless you’re just copy and pasting things), but Arduino certainly tries to brush some of the unfortunate realities under the carpet.
In the process they’ve created a situation (
-fpermissive) that can cause pitfalls for even very experienced programmers. The kind a beginner couldn’t even hope to fathom.