A computer program is a narrative that follows a logical story line within constraints of a programming language ..and run time !
... certain parameters, as variables, are typically, for user inputs. Based on the variables, the program comes out with different outputs. In essence, the computer program allows us to visualize different scenarios of a narrative - just the way our "thought" allows us to visualize different scenarios of our physical actions (past or future).
Computers are useful in the sense the narrative variants stay immutable. Our minds, on the other hand, keep changing the narrative synchronously ... with variables... leading to phenomenon called "emotions".
Emotions take hold when we are unable to analyse all the possible scenarios of all the possible narratives for a given situation - may be because we run short on compute or time. In the realm of AI , emotions are called hallucinations :-)
Hallucinations may be mitigated with reinforced learning just the way we can overcome emotional outbursts through practice.