Three things I learnt from The Pragmatic Programmer - Chapter 3. Link to chapter 1 here.
1. Balance Resources. If you have a large piece of data that is accessed in your program, don't forget to close it. If a variable, set to 'Null' when done so garbage disposal can delete it. Always allocate resources in the same order, and de-allocate in the reverse.
2. No one writes perfect code - use assertions to check you have the data you expect. You can't rely on testing to catch every eventuality.
3. Avoid big feedback delays, try things out in small steps instead. Try using REPLs to understand a new API. Use unit tests on new pieces of code.
Comments
Post a Comment