One key factor you’re missing is attention.
The difference between talking to a passenger versus using a hands-free phone is an interesting one. While they intuitively feel similar, it has been shown that speaking on the phone results in significantly worse performance. This is because a passenger shares awareness of the driving situation and surroundings. Their conversation naturally adapts to traffic conditions, often pausing or shifting topics to focus on the road, which can help with awareness.
Texting and eating are far more dangerous as they divert eyes from the road and introduce motor interference. Fatigue also severely degrades both attention and cognitive function.
Coding while driving does seem unnecessarily risky though. Unlike other non-motor distractions, it demands more cognitive engagement without necessarily moving your hands or eyes. It is far more demanding than a standard phone conversation, which has already been shown to impair driving.
You will make errors that you won’t remember because your brain is occupied with the code rather than monitoring the environment.
Your ability to recognize objects and react slows down. If a child runs into the road, that split-second delay could mean the difference between stopping or killing them. The same applies to sudden obstacles like kangaroos in my case. The delay in reaction could turn a near-miss into a fatal crash.
Most of the risk lies in the complex and unexpected situations. It's really not worth it, just listen to some music or an audiobook and enjoy your ride. Do coding later.
If you have any other psychology or cognitive-related questions to it I can try and answer. I'm not an expert in this specific area but we did some work on it at university.