Recommendations for splitting java / javafx debug / development code

I work on a game in JavaFX, and from time to time I send people a compiled game to try. Since I'm still in the middle of development, I have several pieces of code dedicated exclusively to development / debugging.

One example is the gamespeed slider, which is very useful for me during testing, but it is VERY buggy and can only be used in a certain way - in other ways, I don’t want this code to be in test versions,

What are the best ways to remove such code?

  • Surround code with if (Config.DEBUG) (setting a parameter in code)?
    • Using if (), but setting a parameter in different build configurations?
  • Can SVN branches save code like this? Or do I need to upgrade to Git?
  • Can annotations be used for this?
+3
source share
2 answers

You can use SVN branches for this, but you continue to make every effort to merge your branches so often. I would not do that.

Although perhaps not very elegant, I would go for the first suggestion: put the configuration parameter somewhere so that your build process can automatically change it for you, and if()around the affected code.

Modify the build process so that it creates jars and test jars at the same time.

+2
source

pure if , ​​ - VM, ( , ). , HotSpot JIT .

, , , .

, - . , , . , , .

+1

Source: https://habr.com/ru/post/1723565/


All Articles