Code stripping?

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.

Thanks
-karen

Wouldn’t they be stripped anyway by virtue of the #if target blocks? Ie., you’re stripping them yourself.

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.

-Karen

Can’t you just delete a big section of code in the submodule, compile it again and compare the file size?

If it’s 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.

Thanks
-karen[/quote]

Someone from Xojo Inc should chime in

No, Xojo compiled applications does not works like this.

I even try to make a search inside a Xojo compiled application to no avail…

You can easily test it.
Methods in Modules should be stripped if you don’t call them.

What I do not tried was to add a very large code, then compile and read the application size (thus very large code).

[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

not for class methods, but as far as I remember for globals, e.g. module methods.

Anyway if @Karen Atkocius likes to know, it’s easy to test.

I’ve asked someone who would definitively know
Will let you know when I get a reply

That’s exactly what I wrote above and you said didn’t work?!