12 | | 1. '''Write''': I have the idea in mind, so I need first to make it working, this is normally ugly code but here, the goal is to make it working |
13 | | 1. '''Make it good''': Then I make better the code, including the methodologies of this coding like correct returning values, making a better structure and a better and readable identation |
14 | | 1. '''Understanding''': Good names in variables and functions is maybe the better correct programming tip that you can have, see the section of convention-names, this is a little slow procedure since thinking in the best names to use requires some brainstorming |
15 | | 1. '''Cleanup''': Now is time to remove all the useless parts, the goal is to use the simplest solutions and procedures, they are usually the most appropiate ones, try to reduce the code the maximum possible, this step consist in multiple reading of the function thinking on ''how it works'', you will discover on this step a lot of bugs in your code that you won't imagine that exists. |
| 12 | 1. '''Write''': I have the idea in mind, so I need to make it working first, this is normally ugly code but, the goal is to make it working |
| 13 | 1. '''Make it good''': Then I make the code better, including the methodologies of this coding like correct returning values, making a better structure and readable identation |
| 14 | 1. '''Understanding''': Good variable and function names is maybe the best programming tip that you can have, see the section of convention-names, this is a little slow procedure since thinking of best names to use requires some brainstorming |
| 15 | 1. '''Cleanup''': Now it's time to remove all the useless parts, the goal is to use the simplest solutions and procedures, they are usually the most appropiate ones, try to reduce the code as much as possible, this step consist in multiple reading of the function thinking on ''how it works'', you will discover on this step a lot of bugs in your code that you won't imagine that exists. |
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. |
| 21 | When you are programming, you will see that your code needs to be intelligent, it 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!, this way we can always know how to deal in specific situations, but keep in mind we dont want a bloated code with confusing states, so we need to think of 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. |
37 | | Your code should be perfect, but in fact, it is not... so don't assume that everything is OK, sometimes by an unkown reason something fails and you could have catastrophic disasters, in order to avoid a buggy application or catastrophic disasters, there's a simple rule: '''always check everything''', simply create short functions for that, for example i have one that is called ''check_directories'' with arguments passed by commas which you should understand what it does, another called ''check_variables'' and another called ''check_files'', I decided to maintain this name-convention there simply because they are in the group of ''checkers'' and to have them by the prefix files_ variables_ directories_ has not much sense. |
| 37 | Your code should be perfect, but in fact, it is not... so don't assume that everything is OK, sometimes by an unkown reason something fails and you could have catastrophic disasters, in order to avoid a buggy application or catastrophic disasters, there's a simple rule: '''always check everything''', simply create short functions for that, for example i have one that is called ''check_directories'' with arguments passed by commas which you should understand what it does, another called ''check_variables'' and another called ''check_files'', I decided to stay with this name-convention, they are simple and they are in the group of ''checkers'' and to have them by the prefix files_ variables_ directories_ make no sense. |
44 | | You don't have a genius memory (specially me), so you can't remember exactly ''what this code exactly does'' or ''why this thing is there'', a good way to avoid that is by adding comments but sometimes you forget to do that or they are not sufficient, in most of the cases you think that you don't need this part of the code, or that should be an old not-needed-anymore element or similar things, what I personally do for accelerate the development process and not think on it on that moment is to add on this step a function called named ''step_requires_fixme message'', which basically runs me a prompt/shell if i come to this state of the code asking me what I'm doing here or to verify something |
45 | | |
| 44 | You don't have genius memory, you won't remember exactly "what this code does" or "why is this thing there", a good way to avoid this is by adding comments but sometimes you forget to do that or the comments you made are not sufficient enough, in most cases you think that you don't need it in this part of the code or that the element of the code is old and not-needed-anymore or similar things. What I personally do to accelerate the development process and to not think about it at the moment is to add on this step a function name "step_requires_fixme message", which is ran at the prompt/shell if I come to this state of the code it will asking me what im doing here or to verify something. |