Coding is like gambling. Why, you ask? I’ll start off by saying that I don’t gamble. But hear me out.
gambler

From what I understand, gamblers live for the thrill of the win. There is nothing more satisfying. And when they lose, they keep going even though they’re hurting themselves because they know that that win is coming, and all the loss will feel okay when it happens (even if when it’s all said and done they’re in the red).

So how does it relate to coding?

You embark on some project, and all the progress you make is gratifying (the little wins) and then you reach a bug, and it’s like you’ve just lost and you won’t stop until that damn bug is fixed. And sometimes that bug hurts; it consumes you. Hours have gone by, and you need to sleep, but you must find that bug and kill it! After that you’ll settle your bets and go to bed. And then it happens - you find the bug! You feel relief, you’ve finally won again!

But then you want more. You told yourself you’d stop, but it felt so good and there’s so much more to be won- this is where the fun begins again, maybe you’ll get on a hot streak!

You get the point. Let’s just be thankful we’re usually gaining more than we lose :).