- As my first slog/blog said that geeks should write because it can help them think and learn from their mistakes.
- so in this slog i'll say the things i learned from writing my own slogs.
Comment on my slogs:
- There may be some mistakes that i may have made during writing the slogs, but i would say i agree with the ideas that i wrote earlier.
- ideas include 1. drawing diagrams when writing code:
- Drawing diagrams help a lot, even the most professional programmers use diagrams to develop complex software.
- The diagrams help understand the outcome of the algorithm that is being written, and then write the algorithm. This makes writing any code much much simpler.
- 2. testing your code frequently.
- Testing your code overtime your write a function or a complex code helps you kill the errors that are in the code.
- Testing with one or four values won't help, test your code with the values that are near its limit or test it with values out of the limit. This way you know the boundaries to your function/code and that can help you kill errors that may occur.
- 3. recursive codes:
- the idea for recursive code was that to think of the simplest input/output of the code first then write the complex recursive code.
- another advice for recursive code is to understand what the outcome is. and to do that you must draw diagrams. this will allow you to think of the problem and solve it quickly.
- another advice for writing recursive code is to first think of why you need the recursion, and what would the recursion do on the given input. This will help you draw the diagram and resolve your problem.
As said above, when you're writing your code, DRAW DIAGRAMS. This will help you understand the code and the problem. Test your code frequently in order to find your mistakes and fix them. Its all about trail and error.



