When is it OK for Java to Break Backwards Compatability?
At Devoxx last week, attendees were asked if Java 8 or 9 should be backwards incompatible, on a community whiteboard. The results from that survey can be seen below: most developers want to see compatability broken to get the new stuff in. In this poll, I'd like to see how important backward compatability is for you when it comes to versions following Java 7?

I would be really interested to hear the reasoning of anyone who things that it's ok to be backwards incompatible.
Image provided by Stephen Janssen.






Comments
Howard Lovatt replied on Mon, 2010/11/22 - 2:24am
My favourite option is to add to the start of a file:
before
package, this way it doesn't break old code (old code doesn't have asource 7line and is therefore 6). The action of thesource 7line is like the source flag and it overrides the flag.I have suggested this a number of times but Oracle don't seem keen :(
Attila Király replied on Mon, 2010/11/22 - 2:51am
Dhananjay Nene replied on Mon, 2010/11/22 - 3:29am
in response to:
Howard Lovatt
Andrew McVeigh replied on Mon, 2010/11/22 - 5:25am
we are basically discussing whether the ongoing evolution of java requires a breaking change.
IMHO all technology must be reinvented/evolve to stay current - everything has a shelf life and if you don't reinvent things move on and make the older technology seem old (the perception factor) and clunky (the modern usage factor).
so, my ideal scenario would be:
1. start 2 streams: old java and new java
-- publicly state that both will be fully supported going fwd
2. new java is then free to
(a) make breaking VM changes (type reification for generics, tail call optimisation etc)
(b) remove redundant or obsolete libraries (corba, awt?, possibly even swing ;-)
(c) introduce breaking language changes
3. look for an interoperability story - perhaps a VM that supports both.
Of course, the above can't happen. It would require far too many engineering resources, and be far too big a risk. So the answer is: a breaking change is not possible - there are too many constraints.
Philippe Lhoste replied on Mon, 2010/11/22 - 7:54am
in response to:
Andrew McVeigh
Gil Collins replied on Mon, 2010/11/22 - 8:12am
I can see both sides of the coin on this.
Breaking compatibility would make many projects have to invest massive amounts of man hours in order to get their code back up to date, this would definitly cause issues and may even have some defectors to other languages since they would be making such an exorborant amount of changes.
On the other hand breaking compatibility could allow more streamlined and advanced capabilities for those companies willing to devote the time and money to move onto the latest version.
Maybe the backwards compatibility stay's by way of creating an API that duplicates what was there but offers new and advanced ways of execution.
Jacek Furmankiewicz replied on Mon, 2010/11/22 - 11:09am
Andrew McVeigh replied on Mon, 2010/11/22 - 11:24am
in response to:
Philippe Lhoste
I guess i meant the AWT peer widget model. What you've just listed, i'd call part of Java2D. Even that's up for grabs though, apparently, with the new JavaFX libraries and updated compositing model.
Jim Bethancourt replied on Mon, 2010/11/22 - 1:14pm
Thoughts?
Thanks,
Jim
Artur Biesiadowski replied on Mon, 2010/11/22 - 1:23pm
in response to:
Jacek Furmankiewicz
@jacek
How manyof your unit/integration tests would detect thing like memory model change which happened between java 1.4 and 1.5? It would completely kill some of my applications (which were written to take advantage of java 5 model) - but am I really supposed to unit-test the way volatile does a memory barrier?
@Howard
How 'source 7' is going to help with things like removing AWT or reified generics (in places where you interact with code compiled without 'source 7') ?
Ronald Miura replied on Mon, 2010/11/22 - 3:04pm
Josh Marotti replied on Mon, 2010/11/22 - 3:09pm
in response to:
Howard Lovatt
Elegant solution that seems to help both worlds. I hope Oracle changes their mind on your idea!
My thoughts: Honestly, I just want generics to work as intended, which means breaking backward compatibility. I want this more than closures, so, please, break compatibility to make a better product. We don't mind...
Cloves Almeida replied on Mon, 2010/11/22 - 5:48pm
Maybe Java should follow Python's route from 2.x to 3.0 series. Fork, from Java 8 into "Java NG" and maintain parallel editions. "Classic" Java would be publicly mantained for a few more releases with appropriate deprecation warnings to soften migration. Deprecation warnings should be printed on runtime usage of deprecated classes and method so code relying on XML/String wiring could be more easily corrected.
Doing "Classic Java" emulation for compiled code to use existing libraries shouldn't be that hard or underperformant.
Oracle could even setup a special support contract (revenue!) for those "can't touch this" doomsday-critical applications that can't be ported.
What shouldn't happen is to allow Java to become the "next COBOL" and be completely ignore for greenfield projects.
Howard Lovatt replied on Tue, 2010/11/23 - 1:37am
in response to:
Artur Biesiadowski
@Arthur,
For things like removing packages as opposed to just deprecating them, you need a module system. One is planned for J8. Therefore source doesn't need to deal with this.
With completely incompatible changes source would simply raise an error. However you could probably do reified generics, my personal number 1, by introducing some new syntax to mean erased or pre-generic code, for example:
There may be better solutions, this is something people will need to work on (it isn't going to be easy to reify generics). However the success of the NextGen project gives hope that it is possible.
-- Howard.
Anthony Goubard replied on Tue, 2010/11/23 - 3:16pm
in response to:
Ronald Miura
9. With project jigsaw (modularity in Java), it will matter less as you won't need the full Java API to run an application.
James Jamesson replied on Wed, 2010/11/24 - 2:35am
Claude Lalyre replied on Wed, 2010/11/24 - 10:19am
Shawn Hartsock replied on Mon, 2010/11/29 - 12:07pm