-1

I am developing a software and I would like to create a lite version of it; That is, some features of the paid version will be removed.

My first initial idea was to have a boolean somewhere indicating if the software is lite or pro and wrapping pro only code into conditions checking against this boolean. On second thought though, it seems like that would be very easy to reverse engineer and simply flick the boolean to enable all pro features.

So my second and current idea is to use the preprocessor to completely omit pro features from the lite version. I am reading however that the preprocessor should rarely be used in production.

Is my situation an exception or are there any better alternatives to achieve what I want?

Filburt
  • 17,626
  • 12
  • 64
  • 115
Nicolas Martel
  • 1,641
  • 3
  • 19
  • 34
  • This question is too broad... Add some specific details... – Fabjan Aug 06 '15 at 09:22
  • 2
    You could use IOC and have two sets of library each providing the features of pro and lite. – Mark Aug 06 '15 at 09:25
  • 1
    This is a perfectly good use case for the preprocessor. With that said, unless there's a compelling reason to have a "lite" version why not simply focus on the full version of the software and make it as stable, polished and functional as possible and priced well, instead of worrying about lite versions and protection from reverse-engineering. – Nik Bougalis Aug 06 '15 at 09:25
  • 1
    Where have you read that the preprocessor shouldn't be used in production? The preprocessor is used at compile time to (in this case) selectively build parts of your code. It sounds like a perfectly reasonable option to me. – Dan Puzey Aug 06 '15 at 09:27
  • @Dan It was one of the answers submitted to this question http://stackoverflow.com/questions/4222338/when-to-use-preprocessor-directives-in-net – Nicolas Martel Aug 06 '15 at 09:36
  • 1
    Probably easier to simply pirate the pro version from the internet, instead of reverse engineering. – kat0r Aug 06 '15 at 09:36

1 Answers1

1

Preprocessor directives add a maintenance burden, because you then have to update different versions and remember to deploy the correct ones.

But still, if your software is quite simple, and you don't trust a simple boolean value (you may overcomplicate that as much as you want), preprocessor directives are your only option.

Alex Mazzariol
  • 2,456
  • 1
  • 19
  • 21