10
Hostard
6y

So I'm writing this code, that does 2 important things, that cannot be seperated. I run the code, thing1 is correctly executed, thing2 not. No fucking idea, why this happens. Execute again, same result. Debugg the wohle thing, now everything works fine.
WHAT?
I check the code, there are no background tasks, no paralell processing, nothing that should go wrong.
Asking a Senior developer for help, he also has no fucking idea. He tells me to try to wait one second between the two things. Looking for a delay() or wait() function in my programming language but there is none. Ok, building my own delay, writing a "do 1000 times" loop, calculate some shit in it. Execute the code, it works perfectly.

Nobody has a fucking idea, why this is happening and why this solution is working, but now the code is productive and it works fine.

Comments
  • 0
    Maybe cashe?
  • 5
    This sounds like one of those errors that make me think "Did I just find a bug in the language itself?"

    Spoiler alert: You didn't. Good luck with that one though sounds very weird.
  • 0
    What language doesn't have a wait/sleep...?
  • 1
    @netikras in ABAP. There is a sort of wait, but it also does some other things (eg. database commits) and the minimal time for the statement is 1s (I figured out, that 200ms are enouth)
  • 0
    Thanks. I'm sooo happy I don't have to deal with such languages... :D
  • 2
    Race conditions or use of uninitialised variables would be typical for that behaviour.
  • 0
    I've experienced this in dotNET before 🙈

    Out of curiosity, what language was it? 😬
  • 2
    @mrstebo The language was ABAP (a relatively unknown language by SAP, but relatively good for large business applications)
  • 2
    Async calls?
Add Comment