reduced version of program using 30% of the code

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
mael15
Super wx Problem Solver
Super wx Problem Solver
Posts: 404
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

reduced version of program using 30% of the code

Post by mael15 » Wed Jan 08, 2020 9:40 am

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.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3906
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Post by ONEEYEMAN » Wed Jan 08, 2020 3:33 pm

Hi,
Do you mean like a licensed vs non-licensed vrsion?

Thank you.

mael15
Super wx Problem Solver
Super wx Problem Solver
Posts: 404
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

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

Post by mael15 » Wed Jan 08, 2020 3:35 pm

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.

User avatar
doublemax
Moderator
Moderator
Posts: 14632
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Wed Jan 08, 2020 5:12 pm

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.
Use the source, Luke!

alys666
Super wx Problem Solver
Super wx Problem Solver
Posts: 317
Joined: Tue Oct 18, 2016 2:31 pm

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

Post by alys666 » Thu Jan 09, 2020 11:28 am

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.
ubuntu 16.04, wxWidgets 3.0.4

Post Reply