While nature has its role, and both of our kids are skilled in math, and comfortable with the geek nature of puzzling over that which is unknown and becoming skilled at it, neither of them are into programming computers, despite both their parents having the background.
Instead, one's a visual artist. The other's a theater geek.
I opened the door to introducing them to programming, but with a light touch, as I knew a hard sell would make them hate it. They weren't interested, though I think one is starting to dabble with MineCraft mods. Fortunately, I half expected it, and they're good at what they like to do, so that will hopefully be a source of contentment for them in the future.
Either, you are engaging the kid's own personal interest in the thing, which has the potential to grow independently of you as a parent,
or, you can demonstrate your personal interest, at a stage while they are particularly fascinated with you - this, they will grow out of.
László Polgár has encountered lots of controversy about his view of child-rearing. My understanding is that his daughters have tended to express support for their childhood experiences.