Search code examples
c++boostpackagebackwards-compatibility

Backward compatibility in Java compared to C++


I am coding in C++ for a while, and I already get used to platform compatibility issue. But now, I realized that backward compatibility is another substantial issue:

How can the Boost libraries be used successfully for important projects?

Many of the Boost libraries are actively maintained and improved, so backward compatibility with prior version isn't always possible.

(Source: http://www.boost.org/users/faq.html)

Does Java have the same issue? I know that the situation is different from package to package, but how about Java packages that are as much famous as boost is in C++ world?


Solution

  • You have conveniently snipped the rest of the answer on the Boost FAQ, which tells you how to deal with this problem:

    Deal with this by freezing the version of the Boost libraries used by your project. Only upgrade at points in your project's life cycle where a bit of change will not cause problems. Individual bug fixes can always be obtained from the boost repository.

    As for the rest of your question...

    Does Java have the same issue?

    Of course. This is not an issue with a specific programming language. It's an issue with 3rd-party libraries or frameworks in general.

    I know that the situation is different from package to package, but how about Java packages that are as much famous as boost is in C++ world?

    There is nothing like Boost for Java, because many things offered by Boost are already part of the Java framework itself, for better or worse. Think of string algorithms or filesystem operations.

    That being said, perhaps Apache Commons comes close. As it turns out, it has its own share of backward compatibility issues -- which, as I said above, is completely normal. For example, the release notes for v4.0 clearly state the following:

    This version uses the generics features of Java 5 and is not compatible with earlier JDK versions.

    (...), we have chosen to break the API in various ways. (...) We have also removed all deprecated classes and fixed oddities in the previous API that we couldn't fix due to backwards compatibility restrictions.

    Keep in mind that both Boost and Apache Commons deal with this fundamental software-engineering problem in a very professional and well-documented way. Unfortunately, the same cannot be said about most other libraries and frameworks you will encounter in the wild, regardless of the programming language used.