On 28/05/12 10:41, Chris Green wrote:
Looking at all the Arduino (and related) stuff it does seem that the code is rather poor, I think it's mostly written by hardware people and it shows.
I wouldn't even go that far, people used to working professionally at this level of microcontroller usually write quite nice code as you need to be as optimal as possible to squeeze into the memory/flash/runtime limitations and yet do anything useful.
That said optimal and easy to read don't always go hand in hand.
But the truth is that the Arduinio project is just full of shit code even the code examples built into the IDE are poor, loads of libraries on arduino.cc are also badly written.
But that isn't the point of Arduino, it's not supposed to be a basis for any serious or commercial project, it's an educational project to present the straightest path to getting something up and running as quickly as possible so new users get instant gratification.
Hence most of the examples and libraries are written to be easy for a beginner to understand rather than efficient.