I’m curious : how would knowing more about electronics improve code ? To me, the basic properties of electricity are hidden behind the higher level hardware components code can interact with
Probably the same way exposure to different paradigms of writing software helps one become a better programmer - more abstract tools in your toolkit, more ways to think about how to solve a problem.
If you're ever dipping down into firmware level stuffs, it makes reasoning about things much easier. I can intuit whole systems, where my software only friends really struggle. Some firmware bugs are immediately debugged with a o-scope.