Getting a programming environment is indeed a barrier which I have experienced a number of times. This contrasts with schooldays when I could start writing a basic program simply by switching the computer on.
Why don't Apple, Microsoft etc. package the stuff you need to get start programming with their OSes? (So one could begin learning with 5 mouse clicks or less.)
I think programmers themselves have a bias against getting started easily. Everyone knows how much they had to struggle to get their environment set up so they expect it to be a hard problem and don't consider it necessary to solve when building an OS. I imagine it's simply not a priority although I wish it was.
"Why don't Apple, Microsoft etc. package the stuff you need to get start programming with their OSes?"
They do, or at least Apple does with the inclusion of a version of Ruby as standard in OSX, various shell scripting options, and Xcode available for free from the Mac App Store (although I would question how easy that is for a novice to get started with). Windows? Not so much.
Those sound like good things but as you suggest this doesn't meet the standard of beginner friendliness.
This would be something like clicking on an application called 'Ruby' in the applications folder and then a window popping up ready to start typing my script in. (If there are choices to be made, fine, just make it work with some default options and I can switch text editor or whatever later.)
The same set-up on every single Mac/PC, out of the box. Every resource required pre-installed and automatically updated with the OS.
No credit cards, no searching online, no knowledge of what is required beforehand, no obscure dependencies, no expert friend required, no need to read instructions about how to set up, etc.
The reason that is not available is that the universe of options for beginning programming has exploded since the old boot into BASIC days, and there is no longer agreement on the easiest way to begin programming.
As for the same set-up on every single Mac/PC, it's already there, it is just slightly harder to get to than you want. It's called a web browser, and there are numerous URLs you can go to that let you program right in the browser.
If anything, the problem is that there are too many answers, targeted at too many starting levels, so it is hard to Google for any likely phrases and get to the answer easily.Searching for "begin programming" seems to give better beginner answers, whereas "learn to program" tends to give more college-level answers.
I see no reason why a kid who is interested in how to do it, and grew up in the modern era around web browsers and search engines and such, would have any trouble finding something quickly.
Microsoft does this by releasing "Express" editions of Visual Studio: https://www.microsoft.com/express, which is available for C#, C++, Basic, JS/Web and Windows Phone. Although the installation is different (Mac App Store vs hunting it down on Microsofts website), what they actually do is very similar.