|
|
|
|
|
by nothanksmydude
2637 days ago
|
|
This is a fantastic example of my favorite programming technique: When nothing makes sense and you're real emotional about it and want to give up... GIVE UP!* *But you have to write another one from scratch tomorrow because there's good odds you'll do it right on accident and will then be able to diff and understand exactly where you went wrong. Being able to identify this situation and when doing this is useful as early as possible will make you very valuable. The break between attempts is important, go do literally anything else besides code. I once spent a week going in literal circles because of some degree/radian conversion errors. The rewrite took about 15 minutes. Never trust anyone's ability to count, not even your own. It's particularly useful in this exact situation, where the differences are mere +'s and -'s, off by one here or there, maybe a bad copy paste with similar looking variable names. Typically math related |
|
https://www.ted.com/talks/tim_harford_a_powerful_way_to_unle....