Larger include's create larger files which create memory bloat.
That is mainly false, The only time it would be true is if you have a bunch of non-constant vars in the include, that where not used in the code. There is really no differance between putting functions into an include and typing them directly into the script. You will just use more hard drive space by typing the same function over ond over again into several source scripts. The scripts themselves will compile the same. To understand this, it is inportant to note, That just because a function is in a source script does not mean that the function will be compiled into the compiled code. If the function Is used by the script it will be present in the compiled code. If the function is not used by the script, It will not be present in the compiled code, reguardless of its presence in the source code. Constants are not present in compiled code at all, The constant lables are simply replaced with the value for the constant before the script is compiled.
Someone correct me if I am wrong, but when someone uses a function in code, where that function is located in an include file.
The compiled script does NOT contain the whole include file, but rather function that was being used.
The include statement is more a less like a pointer, or directory location, telling the compiler where to look for the relevant functions.
at least from my own observations, I noticed that ncs files would be hefty in size, if I used hefty functions from include files, but the sizes remained small, if I used the smaller functions from the include file.
in effect,
##include "my_include"
void main()
{
MyWonderfulFunction();
}
** My_Include <-- my example include file
##include "aps_include" <-- Which also includes a file of its own
void MyWonderfulFunction()
{
WriteTimeStampedLogEntry(SQLEncodeSpecialCharacters("Hello World"));
}
Inside my void main using script, it calls
'MyWonderfulFunction()'
Which in turn calls
SQLEncodeSpecialCharacters() inside
'WriteTimeStampedLogEntry()'
In the compiled ncs file, it will contain the binary code for at least these 3 functions, and any sub functions they use.
So,
The code from my_include - for MyWonderfulFunction() Will be added, which will also include within it, the code for the sub functions it uses.
All in all, while the scripting language loots neat and tidy, being a single call to a function, it gets complicated post compiler, because it embeds the code from the include files into the final articles.
Infact, you could delete the ncs and nss include files from your module, since they are not accessed post compiling.
All used functions from your includes, are accessed from the ncs of the scripts that use them, the includes are kept only for future modifications if desired. (Which is why you need to compile the void main scripts again, compiling the include files will not update the include using scripts.)
Anyway - I kinda went off on a tangent there - I just wanted to post my own observations on that topic matter.