top | item 16222383

(no title)

bmomb | 8 years ago

Thank you for your comment, sometimes im bit to hard on myself;

I can learn from my mistakes, but some of them are really trivial, i can find better examples in math, like:

In a calculus question, I need to find the volume inside some functions, this type of question is not new, i know how to solve, but somewhere deep in the calculation i change 'integral of sin' to be `cos` instead of `-cos` making the everything more hard to solve and obviously getting the wrong answer.

This kind of thing is currently my biggest problem and i cant find a real way to improve.

discuss

order

candiodari|8 years ago

This is the sort of thing that reviewing other people's performance can really help with. Offer to teach classes, grade homework, or whatever.

Second thing that helps me pretty well is doublechecking through another path. You know, figure something like this out, check if the angles of the triangle still add to 180, check if substracting half the equation from the previous step still yields the same, that sort of thing. For the problem you said, find an "easy" definite integral that is easy to calculate (e.g. a sine is 180 degrees of the unit circle, so integral(0,1,x->sinx) is p/4).

So take a "trivial application" of the mathematical expression (like calculating the area of the unit circle), and execute it on every step, calculating what should be the area of the unit circle. As long as you replace expressions with equivalent expressions the outcome should stay the same.

And for coding, unit tests, but more than that, running the code, using a debugger or so.

AndrewDucker|8 years ago

Look at your intermediate steps, and ask "Does this look like the right answer?" at each point.

Nobody's memory is perfect - so it becomes a question of "How can I tell if I'm going down the right route, and how can I test to spot the mistakes I know I'm going to make?"

Clubber|8 years ago

Everyone makes mistakes, the trick is catching them before you release to QA. In your math example, you should have some sort of test harness that tests your method against known inputs and outputs. It can be as simple as a throwaway console app.