Lucky to have the good friends that I have? Still yes. Had I simply sat on the other side of the room of CS101 I'd have joined a different project team and have had different friends in school and to this day.
Lucky to be a gainfully employed programmer on salary? I feel I could do that 10 out of 10 times. Or 9 out of 10 times if it helps the conversation. In different realities I'd work at different companies. Specialized my talents differently. Probably even live in a different city. Definitely have a different partner. But I'd have a good job somewhere. In that I'm confident.
I've been "unlucky" in that no project I've ever worked on has ever blown up. Never seen a fat bonus. I've still drive the same 1999 Volkswagen Jetta I got in 2004. No fancy car for me. No lucky stock options that hit it big.
I'm arguably lucky to be a programmer. Born in a good year for it. But I don't think I'm lucky to have a good job that pays well. If I were born a few years earlier I'd simply have picked a different career. I could have been a lawyer. Or a mechanical engineer. Even a doctor. I find a lot of things interesting. For careers I'd have always picked something interesting that pays well. I like teaching people quite a lot. But it doesn't pay well. So it was never a consideration. If teachers averaged 6 figures it'd have been on my short list as well.
A long article was very recently posted either here or on reddit - was it the Washington Post? Don't remember unfortunately - about mass murderers. It looked at the actual research and tried to dispel myths like "they are all mentally ill, so if we just fix health care for mental illness to discover such people early we can solve much of the problem". The actual statistics showed that less than 10% of mass murderers (I think that was "more than two") had a treatable mental illness. Turned out that the major determining factor instead was "environment". Of course, individual factors such as certain personality traits play a role - but they are the same ones that can be found in successful people (it helps to be "full of yourself" and not dwell too much on what other people think, unless it's important for your own success). Whether such traits make you a murderer depends on your environment much more so than anything else.
And here we get to "luck": Environment is a lot of luck, the initial settings matter most of all (the womb you crawled out of). Environment can greatly enhance - or dampen - whatever you inherited genetically. Who will do better, an Einstein born in a favela of Rio de Janeiro surrounded by gangs, or an average guy born to wealthy parents? Example: G.W Bush... Those are extreme examples, but even if you only look at relatively equal American middle class examples, but one ends up in a group of peers mostly interested in girls and booze, the other one in a group of kids with more academic parents and more interest in learning than party will be influenced by the group.