This is basically an open letter to the Arduino team:
While it is nice to have an "official" release of the Arduino s/w. The official 1.0 Arduino release
comes with a very high price as it has changed several things in a non backward compatible way.
While the changes to pre 1.0 code are typically minimal to get it to compile/function on 1.0,
the changes are usually beyond the expertise of the intended target audience of the Arduino.
You have to look no further than all the recent posts going on in several of the forums asking
about all the "strange" errors they are seeing when building their code on 1.0 and why
their sketches suddenly no longer work or no longer fit in their AVR after upgrading to 1.0
What is somewhat sad is that the Arduino platform had become fairly stable over the past few years
and the number of 3rd party libraries and 3rd party hardware devices that use custom libraries
floating around on the Internet is quite numerous.
The 1.0 release breaks 100% of those existing libraries and some of the existing projects that use those libraries
will fail to function correctly even when the libraries or sketches are updated to compile with the 1.0 release.
In recent years, the pre 1.0 code had essentially become a long term running beta release project which had created a very
stable platform which was very good for the "Arduino" brand and especially good for novices since
the majority things "just worked", including 3rd party libraries and sketches directly out of the box.
1.0 has changed several things in such a way as to be very disruptive and has created instability
in the Arduino platform that is going to last for at least several months if
not much longer as users struggle with trying to get their sketches and 3rd party libraries
up and working.
Contributing to the problem is that the 1.0 release candidates were not very well advertised on the Arduino
Web site. Announcements and links to the release candidates were not put on the main download web page
along side the latest 022/023 releases.
As a result not many users and library developers were actively beating on
it and using it to help discover issues prior to its release.
The end result is that 1.0 is less stable than 0022 or 0023 from a novice user's point of view
because he continually sees that example sketches and libraries he downloads from the internet
or that come with his 3rd party hardware device no longer work with Arduino 1.0
A brief list of some of the issues
- 100% of all the pre 1.0 libraries will not compile under 1.0
- certain core header files changed names
- some function names in certain libraries changed (example: ic2 send() is now write())
- some functions have the same name but do something different (hardware serial flush() is an example, Print print() is another)
- flush() on SoftwareSerial() and HardwareSerial() in 1.0 do totally different things.
- 1.0 generated code is larger and can cause sketches to not fit
(ethernet code appears to have grown by more than 4k or 80+% in size)
(SD library is also quite a bit larger) - serial code is larger and forces user to use buffered i/o output which changes timing and eats up additional RAM.
It is one thing to add new functionality, it is another to break existing functionality especially
when it is to the level of breaking 100% of the existing code (libraries) from even being able to compile.
Part of the reason that I think the instability will drag out over many months if not longer is that
today, nearly everything will work with pre 1.0 Arduino so there is no immediate need for most users
to upgrade to Arduino 1.0. As time goes by and developers "update" their
code to work with 1.0, some will update their code in ways that no longer work with the pre Arduino 1.0 code.
This can create frustrating situations for the end users that use multiple libraries or code from different
sources in that they may end up in a situation where some of the code only works with pre 1.0 tools and some only works with 1.0 tools.
IMHO, way too much was changed way too late in the game with Arduino 1.0
especially given that some of these non backward compatible changes like the header
file name changes didn't add any additional new functionality.
Also I'm guessing that there will inevitably be additional non backward compatible changes needed
to support the newer non AVR based processors in Arduino that will eventually be worked into
the Arduino tool set.
So I predict that users will not only have to go through the pain of this 1.0 transition
but users are more than likely going to have to go through additional pain again in the near
future as the non AVR based processor support is added into the Arduino toolset.
So that is why I wonder if Arduino 1.0 will be to Arduino what Vista was to Microsoft.
A release that worked fine for some people but many others were not very happy with.
--- Bill Perry
Now since I believe that all criticism should be constructive,
I will offer some suggestions to try to improve the existing situation.
At this point my suggestion would be make using pre 1.0 code much easier use.
And while I know many people would like have a "don't look back" type of mindset
and just tell folks to "get with it" and update their code for 1.0, it really isn't that
simple if you want to continue provide a good user experience especially to less
technical users that may be using libraries and code they find through internet searches.
I believe that the best way to do this is by creating a way to make pre 1.0 code "just work" on the 1.0 release.
Barring re-releasing 1.0 with the pre 1.0 code of say 0023 - which I doubt the Arduino team would ever do,
the best thing would be to put in a "pre 1.0" backward compatibility mode option
in the IDE to help with the transition.
While it wouldn't offer the identical code and sized code as pre 1.0 it would allow
all pre 1.0 code to continue to compile and function under Arduino 1.0
It isn't' that difficult.
My suggestion would be handle to this by offering a "0023 emulation" mode
that sets ARDUINO to 0023 instead of 100.
For dealing with the header file name changes:
You create a new directory:
hardware/arduino/cores/arduino/deprecated
In that directory you create the header files that have changed names
and they are simply stub header files that include the new header files.
hardware/arduino/cores/arduino/deprecated/WProgram.h would include <Arduino.h>
hardware/arduino/cores/arduino/deprecated/wiring.h would include <Arduino.h>
etc..
To enable this deprecated directory to work,
the IDE would add the deprecated directory to the include path when the
"0023 emulation" option was enabled.
For the wire library function name changes:
In the wire library. Add the send() function back in that is a wrapper for write()
with no return status. This will allow older code to continue to use send() with no changes.
This could be handled with or without conditional compilation.
For Print class, add a conditional to revert the print() and write() functions back
to their pre 1.0 functionality and return status.
For HardwareSerial, add a conditional that:
- reverts the transmit back to no buffering
- reverts flush() back to pre 1.0 meaning
- reverts write() back to pre 1.0 void status
For SoftwareSerial
Since flush() didn't exist pre 1.0, this just needs to be fixed.
Fix flush() to work like the 1.0 flush in Hardware Serial.
(waits for the tx buffer to drain vs empty the rx buffer Q)
[ I'm sure that there are others, but there aren't that many in total ]
The overall suggestion is to update the 1.0 IDE, libraries, and core code to include a conditional
(which would be off by default) which can be set in the IDE that can be used to force things work/behave/be named
like the pre 1.0 release.
There are not very many things that need to updated with conditionals and it wouldn't take that long.
I'm guessing that if you consider the amount of time and resources that will be spent tacking down 1.0 transition issues
and explaining these to users and helping them fix their code, I'd bet that it would be less time and effort to
simply update the Arduino libraries, core code and IDE to provide a pre 1.0 mode.
The beauty of having a pre 1.0 mode option available from the IDE, is that this solves the problem for everyone all at once.
--- bill