Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Branches (and the 2/3 repositories really means branches—you don't push files, you push branches) are great tool for temporary divergence and great tool for bugfixes to stable releases while working on next one, but they are totally unusable for maintaining long term similar but not equal versions. #ifdef is time proven method for that; too bad Java chose not to support it. Commented Oct 7, 2011 at 13:14
  • @JanHudec, #ifdef can be replaced by better less hacky things. The only really compelling reason to have it is for compiler/platform madness, which Java doesn't have. Commented Jul 21, 2014 at 6:06
  • @PaulDraper: Java doesn't have as much platform differences (Android being a case in the point), but if you have 30 customers and need to ship slightly different version to each, Java changes nothing in the picture and the lack of conditional compilation is now a pain. Note that C# does have conditional compilation for exactly this reason. Commented Jul 21, 2014 at 7:37
  • 1
    @PaulDraper: A lot can be done by having different subclasses for use in the different variants and I am all for it, but in practice there are cases that are difficult to handle that way or the extra inheritance makes things less readable in the end. Commented Jul 21, 2014 at 7:40
  • @JanHudec, "in practice...makes things less readable in the end". Agreed. That a pretty good summary of Java ;) Commented Jul 21, 2014 at 7:43