attempting to do:
IP address method that validates range of 0 - 255 for each set of numbers.
error:
not an error more of a question about approach and best practices.
microsoft's provided example is a void function, which appears to toggle a globally declared boolean to true for evaluation
my example uses a bool function to evaluate truthiness based on return value of 1 for a locally scoped variable.
I believe somewhere along these learning modules, we encounter an introduction about the following concept:
"minding variables so that your security and logical footprint is small".
Technically the footprint of using a locally scoped variable is smaller when considering:
you can get away with same eval functionality while having the function ONLY have access to that variable.
while the globally defined boolean could be seen as taking up more space than it needs?
proposed approach:
keep either use case in your mind as they both work?
attempting to do: IP address method that validates range of 0 - 255 for each set of numbers.
error: not an error more of a question about approach and best practices.
microsoft's provided example is a void function, which appears to toggle a globally declared boolean to true for evaluation
my example uses a bool function to evaluate truthiness based on return value of 1 for a locally scoped variable.
I believe somewhere along these learning modules, we encounter an introduction about the following concept:
"minding variables so that your security and logical footprint is small".
Technically the footprint of using a locally scoped variable is smaller when considering: you can get away with same eval functionality while having the function ONLY have access to that variable.while the globally defined boolean could be seen as taking up more space than it needs?
proposed approach: keep either use case in your mind as they both work?