If I have private (activity-specific) constants, should I declare them in:
Sub Globals - has the right scope, but are redeclared each time the activity is created
or
Sub Process_Globals - process scope can be overridden with Private keyword, and only declared once (more efficient?)
Background:
I have dozens (sometimes hundreds) of constants, mostly enumerations or shared strings, like this:
Normally I would just follow the natural scope and make these activity constants (i.e. in Globals), but I started thinking that a large number of constants is inefficient to redeclare each time the activity is created. Then I thought "Meh, it's just integers and strings, no big stress to recreate them."
So, is there a best solution, or is it just a matter of style?
Thanks!
Sub Globals - has the right scope, but are redeclared each time the activity is created
or
Sub Process_Globals - process scope can be overridden with Private keyword, and only declared once (more efficient?)
Background:
I have dozens (sometimes hundreds) of constants, mostly enumerations or shared strings, like this:
B4X:
Dim Const FILE_SUCCESS As Int = 1
Dim Const FILE_CORRUPT As Int = 2
Dim Const FILE_MISSING As Int = 3
Dim Const FILE_FORMAT_SKETCH As String = "png"
Dim Const FILE_FORMAT_HTML As String = "html"
Normally I would just follow the natural scope and make these activity constants (i.e. in Globals), but I started thinking that a large number of constants is inefficient to redeclare each time the activity is created. Then I thought "Meh, it's just integers and strings, no big stress to recreate them."
So, is there a best solution, or is it just a matter of style?
Thanks!