Writing code is always a learning experience. No matter if you just started coding yesterday or have been coding most of your life there is always something to learn. Writing bad code is about those times that you learned something from your mistakes.
Share your learning experiences by tweeting with the hash tag #iWriteBadCode.