Take the 2-minute tour ×
Personal Productivity Stack Exchange is a question and answer site for people wanting to improve their personal productivity. It's 100% free, no registration required.

I am a programmer, and I discuss when I code, but everytime I compile, there are at least 1 to 3 bugs. For the math questions I do, given 10 questions, no matter how easy it is, I consistently have errors in 1-2 questions, no matter how many details I check.

I start thinking, is it subconciously I wish myself to go wrong? How should I overcome this?

share|improve this question
1  
Are you making the same mistakes or different ones? –  superM Mar 12 '13 at 10:14
    
@superM same mistakes, over and over again. –  william007 Mar 12 '13 at 14:00
1  
I think you can try making a list of the mistakes you make, and while you work on a new problem go through that list and make sure you didn't make those mistakes again. This will not reduce the reason (which I can't know), but will help fight the consequences –  superM Mar 12 '13 at 18:26
add comment

6 Answers 6

In programming, bugs are a fact of life. No developer should expect zero bugs. Large applications have thousands or millions of bugs.

Instead plan what to do with the bugs you discover.

  • learn from them. Try not to make the same mistakes again
  • understand why you make these mistakes. Is it a particular class of bugs? Perhaps you need some training in that aspect
  • prioritise bug types. What is most important to get right?
  • plan your code reviews to focus on your priorities

Don't panic about it. It is normal!

share|improve this answer
add comment

For programming, are you writing unit tests? The unit tests are supposed to catch the bugs even before you commit. It's also harder to make the same error in both the code and the test. (unless it is a logic error.)

share|improve this answer
add comment

If you notoriously code sloppily, there are some things you can do to improve the situation:

  • Use test-driven development (TDD). It is great for avoiding bugs, as it requires you to write tests for your classes and functions.
  • Avoid interpreted and loosely typed languages as programs written in such languages may contain lots of bugs which only occur during runtime.
  • Use a language which handles memory allocation/garbage collection automatically for you.
  • Use an IDE with strict error/warning checking settings. That will highlight potential problems.
  • Be sure to document your code so that it is clear what it does.
share|improve this answer
add comment

When you read something difficult, like a legal agreement, it's difficult to understand every word. But you read the whole thing first, then go back to understand the words.

Similarly, when you code something complicated, it's difficult to keep it bug free. Just keep doing it, finish what you're doing, note down the bugs, and go back and fix the bugs. Otherwise, you'll never see the big picture if you spend your time worrying about bugs.

After you've done it a few times, you'll make less and less bugs. If you've ever started with C or PHP, there was probably a time when you were making fatal errors due to forgetting semicolons... now you're experienced enough that you never worry about it.

If you haven't done so already, I highly recommend getting a bug tracker and a to do list for your projects. It's probably one of the most important things I've picked up from the programming.

share|improve this answer
add comment

its ok, to have write bugs, till they can be detected, resolved and not repeated again..., So learn from your bugs, and if possible document the bugs that you create, it ll help you not to repeat it again...

share|improve this answer
add comment

I'd say you're lucky your problem is consistency rather than, say, understanding. The fix is repetition, which some may see as lost time but as you say it improves problem solving ability. Unfortunately it can be a bit boring, so one solution is to get problem sets that are -so- simple you don't notice how long it takes. Unfortunately I don't have any links, I don't know what level (or what branch of math) you are at. Try asking friends for their p-sets or doing easy ones you see laying around.

For programming, try e.g. http://www.acmicpc-pacnw.org/results.htm. Do the same problems over and over and you will not only get more consistent but faster too. For typing (c.f. another question of yours that was unfortunately closed) try something repetitive like http://www.10fastfingers.com over, say, Typeracer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.