Few things to understand,
If debugging is the process of removing software bugs, then programming must be the process of putting them in.Because, it is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.