I know the compiler strips unused modules and classes, but what about submodules of modules?
I have code organized like this:
XplatformModule
MacMethodsClassesModule
WinMethodsClassesModule
LinuxMethodsClassesModule
The submodules are only accessed from the main module, but only if the app is on that platform (using #If target blocks)
In this case would the submodules for the other platforms be code striped? That is what I would like to happen.
Putting the platform specific stuff into it’s own modules helps when one needs more than a simple declare or small snippet of platform specific code and in general helps keep methods small and easier to read…
I realize I could make then all top level modules and just put them in a folder to ensure the platform specific modules would be striped, but doing it this way helps keep the navigator better organized IMO, and promotes information hiding and not adding more cruft to the global namespace.
My understanding is that code stripping only happens at the class or module level, but I don’t know if that is only for top level items.
If only one method in a module is called (or property accessed) , they rest of the methods, classes and properties are not stripped and the module is included,
So while the classes and methods in the submodules for other platforms would not get called, in this case the submodules are members of a module that has code that WOULD be called, so that top level module that they belong to would NOT get stripped…
What that means for submodules, if anything because they are part of module not being stripped, would depend on how the complier was coded.
Cant you just delete a big section of code in the submodule, compile it again and compare the file size?
If its stripping it then the size will be the same.
[quote=482361:@Karen Atkocius]I know the compiler strips unused modules and classes, but what about submodules of modules?
I have code organized like this:
XplatformModule
MacMethodsClassesModule
WinMethodsClassesModule
LinuxMethodsClassesModule
The submodules are only accessed from the main module, but only if the app is on that platform (using #If target blocks)
In this case would the submodules for the other platforms be code striped? That is what I would like to happen.
Putting the platform specific stuff into it’s own modules helps when one needs more than a simple declare or small snippet of platform specific code and in general helps keep methods small and easier to read…
I realize I could make then all top level modules and just put them in a folder to ensure the platform specific modules would be striped, but doing it this way helps keep the navigator better organized IMO, and promotes information hiding and not adding more cruft to the global namespace.
[quote=482449:@Christian Schmitz]You can easily test it.
Methods in Modules should be stripped if you don’t call them.[/quote]
The compiler has never stripped at the level of a single method