Imagine how different being a programmer was before the distractions of the internet. You might not even be in front of a screen all the time. I am sure a lot of time was spent preparing punch cards and in front of chalk boards. Overall I bet it was much better for mental health.
Yes, this is a major factor that's often overlooked. I grew up doing child-level hacking in the 80s and then got into real hacking in the 90s as the commercial internet was first starting to blossom. While the reality I inhabit now as a programmer is dominated by the Internet, my habits are more like pre-Internet programmers.
If I were to make an accurate account of all the time and energy that goes into my most successful and well-engineered software products, the majority of the productive time happens "offline" from the Internet and/or even my laptop's screen.
I spend a ton of time turning the abstract parts of the problem over in my head while doing "nothing" (or during the mundane tasks of everyday life), and even when I do get in front of a screen, I still spend a ton of time just sketching out notes in a text editor - basically arguing with myself until I've managed to jot down some good conclusions on how the design of a Thing should be done. Most of those notes get thrown away eventually, as they materialize into resultant source code. I have sometimes spent weeks or months turning an idea over in my head or in these textual debates with myself before a line of code is ever written.
But at least since the late 70s the kids then who were able to purchase a machine at home (Apple II, Commodore) did manager to stay 24 hours behind a screen. And a lot of interesting things came from that era.
I'd argue that it's not the distraction or time spent before a screen, but the complexity software engineering becomes. Back in late 70s and 80s if you owned a personal computer, you can literally map the whole memory into your brain. A commercial game could be developed in under 2-3 months. Just look at how ID Software managed to pump out tons of games in under one year. They are definitely very talented, but how come they don't do it nowadays, or even in the late 90s?
Nowadays computing is the red sea where competition is cut throat and even great talents only get to work in a niche area.