For this topic, where are going to take this post a little different. Certainly, it doesn’t exist a strictly protocol for code revision since the way programmers or just people that code approach to solve a problem may vary and this is due to their shape of thinking. That’s the magic of programming. Acknowledging this, I’m going to break the structure of my previous posts and just show you some techniques and tricks that I found on the web and my personal experience for code revision. Let’s get started.
A little bit of intro…
We define “Code Revision” as an activity of feedback when you write whatever code. This can help you from remembering what your code does to some other complex findings such as memory leaks and buffer overflows. And obviously we couldn’t forget finding errors, that probably is where we practice the most our code revision.
Code revision, some good practices.
///Comment
Commented code, worth two. Every programming language has a concept of a comment, which is a way for developers to leave notes in the code, without the language runtime trying to execute the notes as programming instructions.
Read out error messages.
Error messages you’ll see are fairly accurate and descriptive. Remember error message does its best to tell you what went wrong.
Guess and Check
If you have an error, you probably have a sense, no matter what small it is, either you are getting into the error or the tip above, keep trying, don’t be scared to mess up, you can always go back or follow tip number 1 to save certain progress. Try different things!
Run everytime you can.
The more code that you change or write between times that you run your code, the more places you have to go back and search if you hit an error. Every time you run your code, you’re getting feedback on your work.
If something doesn’t work, print!
On every single line of code, you should have a sense of what all of the variables values’ are. If you’re not sure, print them out! Else, if you’re iterative method is doing something wrong, print!
My personal experience.
Some thoughts I can share with you is that this activity eventheless it sounds basic and ordinary, code revision has helped me in different ways, like solving errors (obviously) but also actually knowing what the code does (specially in recursion or really iterative methods). And this is because in this “phase” of programming, you can approachin your own rhythm and go back and forward in a sense that repeating this type of feedback helps you to get certain programming concepts get stuck in your head. Personally I use the “debug” option available in most actual IDLE’s (I use Eclipse), which is an interface that goes along with you in the execution your code in addition to the updates of your variable’s values.


Leave a comment