The Arduino IDE allows to use advanced C++ features like classes and operator overloading. There are not many Arduino sketches that uses these features, but it can help to make your code more readable and maintainable.
This is an example how to make the standard “blink” example easier to read:
So instead of writing
digitalWrite(LED_BUILTIN, HIGH) whenever you want to light up the LED, now you can just write
led = 1. You can create more objects for other pins as well, which makes your program much easier to read.
Left as an exercise to the reader: implement a class for reading pins.
You could move the class to a separate library, then you need just one include to use the class, without always copying the class declaration in your sketch.
This example was inspired by the PortOut class of the mbed framework.