As someone who doesn't know Ruby, I would like to point out that this program is an excellent demonstration of why Ruby's non-standard syntax is awful, confusing and hard to learn!
Ruby's syntax for defining a function is apparently:
fizz_buzz = ->(number) do
... stuff ...
end
This is very confusing if you've used C where -> is a binary operator. I understand what it does, but only because I've used Coffeescript. And the "do" keyword in most languages is used to signal loops, apparently "do...end" is a block delimiter in Ruby instead.Having functions be defined with expressions is confusing.
The string mess on the next line is an awful feature that makes languages such as shell, Perl and PHP bug-prone -- and no exception here. Apparently double quoting in Ruby means next to nothing, because it seems like a damn-near Turing complete language which has magic meaning inside quotes. The double quotes, pound sign, braces, and question marks have meanings here that are rather non-obvious.
Pff easy.
I suspect learning programming is hard because programming in any particular language isn't just the language.
It's also an eco-system. Libraries, learning how to find things that others have done. It's what your program is connected to, how to interface with other devices and things written in other languages, (and so on.)
Most tutorial books I've read are tours of the standard library functions that the author uses regularly. Perhaps communicated via toy programs, perhaps not. If that's the interface people are initially presented with, (and I'd be amazed if that's not most people's experience of Learn To Program tutorial books,) then of course programming is going to be hard to get into.