Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/08/11 16:17
Modified:
  07/08/11 16:24

Read: times


 
#182822 - Another personal preference
Responding to: ???'s previous message
I try to not use initialization unless I have a good reason. I like to have a method that can be called at anytime to allow for the re-initialization of those global variables (as in Michael's case 3), but I would probably go further and add multiple methods for greater control over which global variables get initialized which are grouped by what the controller controls (or however one wants to group them). Then if a variable is defined within a method, but is guaranteed to have a default value based upon an initialized global variable, I will generally leave this value uninitialized as initializing this variable would serve no purpose and would confuse the reader of such code.

Being a firmware oriented person rather than a software oriented person, I take the minimalist approach, which generally means that the code has to be written tighter and highly coiled. Every line of code has to stand out and count like a move in chess.

List of 8 messages in thread
TopicAuthorDate
Variable Initialisation            01/01/70 00:00      
   a question for (the) Raisonance (forum)            01/01/70 00:00      
      Depends on amounts of global data            01/01/70 00:00      
      Yes - Ask Raisonance!            01/01/70 00:00      
   Personal Preference Here            01/01/70 00:00      
      Another personal preference            01/01/70 00:00      
         My code based assignments are...            01/01/70 00:00      
            OO classes            01/01/70 00:00      

Back to Subject List