Page 1 of 1

reduced version of program using 30% of the code

Posted: Wed Jan 08, 2020 9:40 am
by mael15
Hello everyone!
I have to create a reduced version of my program that uses only ~30% of the code. What is the best practice to do that? I am thinking about defining a preprocessor symbol and using it extensively in my code to exclude certain parts. But I am hesitating because this feels a little outdated.
Is there a more elegant/modern way to do this?
Thanx you.

Re: reduced version of program using 30% of the code

Posted: Wed Jan 08, 2020 3:33 pm
by ONEEYEMAN
Hi,
Do you mean like a licensed vs non-licensed vrsion?

Thank you.

Re: reduced version of program using 30% of the code

Posted: Wed Jan 08, 2020 3:35 pm
by mael15
No, what I mean is: The full version has some creating, editing and viewing features of custom files, the reduced version should only be a viewer.

Re: reduced version of program using 30% of the code

Posted: Wed Jan 08, 2020 5:12 pm
by doublemax
I can't think of any better way. If it's ok, that the actual code parts remain in the executable, it might be less effort if you use conditional compilation to only remove the GUI elements for the things the user should not have access to.

Re: reduced version of program using 30% of the code

Posted: Thu Jan 09, 2020 11:28 am
by alys666
1.preprocessor
2. void interfaces implementaions.
if you have interfaces and their implementations, then you could define void implementations(which do nothing) and use them in restricted version.