Pages: [1]   Go Down
Author Topic: I think deleting WProgram.h was a bad idea  (Read 2788 times)
0 Members and 1 Guest are viewing this topic.
Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1926
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I wonder why WProgram.h got deleted. Wasn't it a better idea to replace the content with #include "arduino.h" and a #warning "This file has been deprecated"?
This way developers get the time to update the code.
I know Arduino doesn't show warnings but still...;

Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 223
Posts: 13910
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This way developers get the time to update the code.

Think this way the developers learn to read the release notes smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No matter how long you provide legacy support, eventually things will break.  1.0 is a clearcut place to make some difficult decisions. 

The developers have been very clear that WProgram.h was going away.  So in essence, the "break-in" period should already be over.  Nobody should have been surprised when 1.0 came out yesterday.  It has been known for months this change was coming.

Whether it changed yesterday or 5 years from now, someone would make the pointless case that "this was a bad time to change it."  Yes, anytime you make a change like that, it is a bad time.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1926
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

James
I didn't make a case about bad timing. So for sure: "I didn't make a pointless case on bad timing". Please don't insinuate I'm a loser who doesn't get the full picture.

My case is that there is no transition period. Anyone who build a tool upon the Arduino library could not do changes before 1.0 was out and has to make changes to the tool and to the code after 1.0 comes out.
The workload could have been "sugarcoated" with some backwards compatibility measurements.
The tone of your mail continues in this trend.

Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

like
Code:
#if ARDUINO >= 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif

?
Logged

0
Offline Offline
God Member
*****
Karma: 26
Posts: 623
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I personally didn't like the decision to completely remove WProgram.h.  It's easy to keep a WProgram.h which merely includes Arduino.h.  I've done this and much more in my support for Teensy (see below).  Ideally, a warning would be printed if WProgram.h is used, but that's not so easy since gcc is run with "-w", so #warning does not work in Arduino.

Clearly keeping a WProgram.h was considered:

http://code.google.com/p/arduino/issues/detail?id=609

I think a bigger problem is that the 4 beta tests and 2 release candidates were never widely available.  Unless you follow the developer mail list, which is often has a high ratio of chatter about coding philosophy to actual people working on real code, you probably never would have known about these 6 releases over the last several months.  Their purpose was to give people time to adapt to 1.0's changes.  But not showing them on the main download page kept them in relative obscurity.

Then again, I've exchanged messages with several library authors over the last year.  The general sentiment was to not worry about porting to 1.0 until it was official.  So perhaps no amount of pre-release access would have helped?

In Teensyduino, I added as much backwards compatibility as possible.  Both WProgram.h and Arduino.h work in both 0023 and 1.0.  print(n, BYTE), Wire's original functions, and many other little things all work perfectly in 1.0.  At least they do on Teensy, where I can publish an alternate core.  I have no control over Arduino.  Even the patches I contribute only seem to get used when they're small bug fixes.

Another very unfortunate issue (which was reported to me only yesterday... I working on a fix now) involves the naming of Udp in Arduino 1.0.  If you try to make a core library that is compatible with both new and old sketches and libraries (maybe I'm the only person crazy enough to attempt that?), the fact that these headers with the same names as 0023's ethernet library are now part of the core library is a major headache.  There does not seem to be any solution using only the compiler's preprocessor, because of the way the include paths are built.  My next update to the Teensyduino installer will include a check for these when installing on 0022 or 0023.

If there's interest from the Arduino Team to provide backwards compatibility with 0023 in the next release, I will certainly contribute patches.  I've already solved almost all the compatibility issues that prevent code designed for 0023 from working on 1.0.  I've also managed to back-port nearly all 1.0 features to 0023.  It's really not that difficult... if you care about preserving compatibility.

Of course, there are a couple 0023->1.0 compatibility issues are impossible by design, like the intentionally different function of Serial.flush() and Serial.print() using unsigned char printing as base 10 number instead of a single byte.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19086
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Think this way the developers learn to read the release notes smiley-wink

Hmmm. Maybe I should read them. The first one brought a smile:

Quote
The file extension for sketches has changed from .pde to .ino ...

A fair bit of file renaming ahead for me, when I download version 1.
Logged


Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 223
Posts: 13910
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
A fair bit of file renaming ahead for me, when I download version 1.

Or associate .pde to version1.exe - at least on windows that might be a possible workaround, old code just .pde, new sketches .ino ?  (not tried )
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Ultrasonic library has not been updated from ITead Studio and still has the line: #include "WProgram.h"
This results in an error and the sketch will not compile. I left a comment on http://iteadstudio.com/application-note/arduino-library-for-ultrasonic-ranging-module-hc-sr04/  We shall see how long it takes them to issue a new library.

Any suggestions for workarounds?
Thanks,
Tom
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19086
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Include "arduino.h" instead?
Logged


0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9696
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A link with some 1.0 info.

http://blog.makezine.com/archive/2011/12/arduino-1-0-is-out-heres-what-you-need-to-know.html
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: [1]   Go Up
Jump to: