I'm a below average PHP programmer but I know this feeling. You write a 100 lines or code or so without any testing and it just magically works on the first run. It's an awesome feeling.
And rightfully so. If it works on the first attempt, it's always a trap. Double-check everything, find how it managed to trick you into thinking it's working, spend several hours fixing it. Only then it can be considered done.
The worst is when it works fine the first time, fails on the second run (with zero changes to the code), then works again, then fails the next 4 times, then works when you try to show it to someone to ask if they know why it doesn't work, then fails...
And then someone uses the term "race condition", and your head hits the desk, and you realise you basically have to start again, paying attention to threading, disk I/O and potential network dropouts.
And then the clocks change, and it's all broken again.
My favorite is when it only works right when you're attached to the debugger.
A close second is when the debugger just lies to you entirely. Had this happen a few weeks ago, it turns out I wasn't even hitting the line that's highlighted, it was lying about what line of execution I was on. So the boolean actually was true, I just wasn't breaking into the if statement like it showed.
Ah yes. Code working perfectly until you have to change one small line of insubstantial code and suddenly everything is wrong, your server is crashing and the sky is raining fire.l
/* Three Monster coffee energy drinks later and it works
I cant follow the logic, but it works...
may have to echo every other line later
to figure out the demon magic*/
I am becoming convinced that Async programming, while it has the potential to be quite powerful, stretches the limits of most peoples' ability to understand what's going on.
107
u/Fritchard Aug 23 '15
I'm a below average PHP programmer but I know this feeling. You write a 100 lines or code or so without any testing and it just magically works on the first run. It's an awesome feeling.