Changes between Version 6 and Version 7 of HowtoGoodProgrammingTechniques


Ignore:
Timestamp:
Apr 1, 2012, 10:49:11 PM (13 years ago)
Author:
Thanatermesis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowtoGoodProgrammingTechniques

    v6 v7  
    1919== States ==
    2020
    21 When you programming, you will see that your code needs to be intelligent, he needs to know ''what to do now'' and how to deal with specific situations, this is a lot more easy to reach with states, in short, '''put boolean states everywhere''' they are cheap!, on that way we can always know how to deal in specific situations, but by other side we don't want to have a flooded code or confused states, so we need to think in a good way to organize them in our code, for example, the prefix '''is_''' is one of the best ones to use, just think about the possibilites to have states marked like ''is_sources_get'', ''is_sources_compiled'', is_interactive''... So everytime your application does a specific thing, you can set or unset the affected variables to define the state/progress of the application to know what to do next. Your application can also have different ways of work, so you can prefix those states with '''mode_''', see for example ''mode_interactive'' or ''mode_editing'', another useful one is also the '''ignore_''' prefix in order to ignore steps on our application.
     21When you programming, you will see that your code needs to be intelligent, he needs to know ''what to do now'' and how to deal with specific situations, this is a lot more easy to reach with states, in short, '''put boolean states everywhere''' they are cheap!, on that way we can always know how to deal in specific situations, but by other side we don't want to have a flooded code or confused states, so we need to think in a good way to organize them in our code, for example, the prefix '''is_''' is one of the best ones to use, just think about the possibilites to have states marked like ''is_sources_get'', ''is_sources_compiled'', ''is_interactive''... So everytime your application does a specific thing, you can set or unset the affected variables to define the state/progress of the application to know what to do next. Your application can also have different ways of work, so you can prefix those states with '''mode_''', see for example ''mode_interactive'' or ''mode_editing'', another useful one is also the '''ignore_''' prefix in order to ignore steps on our application.
    2222
    2323== Special Situations ==