On Mon, May 28, 2012 at 09:44:05PM +0100, Wayne Stallwood wrote:
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.
'Quite nice' in some ways but often not in the way that would be accepted as 'best practice' by a software engineer.
That said optimal and easy to read don't always go hand in hand.
That's very true, though even Arduino systems have way more memory than I was used to working with back in the 1970s and 1980s when I started.
It's often neat, elegant code which takes less space anyway.
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.
Instant *hardware* gratification isn't it? It's certainly what
The Arduino home page says "Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. "
An "electronics prototyping platform" says it - hardware.
Hence most of the examples and libraries are written to be easy for a beginner to understand rather than efficient.
But they're not are they? (easy to understand that is)