>Why are "garbage" tutorials getting high rankings in search engines?
Because John experiments with X for the first time and writes about it on his blog. Janette has the same problem while learning about X so she takes his code, makes a few changes and puts it on her blog. This scenario happens 8 more times and we have 10 low quality tutorials about how to do things, but none of the authors has experience and expertise in X, and they won't admit it. Bad practice is copied to many places. 1000 garbage kill 1 gold.
The same exact mechanism (and the parent already alluded to it in his comment: "Janette has the same problem while learning about X so she takes his code, makes a few changes and puts it on her blog").
Non experts look for tutorials,
They chance upon tutorials by non-experts
They don't know enough to tell they're junk
They use the code, link to, and suggest those tutorials to others
Those tutorials are getting higher ranks, attracting even more non-experts
Because search engines don't rank quality of source code and tutorial, they rank page layout, bolds, italics, font color and page speed. Literally any garbage can get to top3, you dont need to be good Ruby tutorial writer for it.
Because John experiments with X for the first time and writes about it on his blog. Janette has the same problem while learning about X so she takes his code, makes a few changes and puts it on her blog. This scenario happens 8 more times and we have 10 low quality tutorials about how to do things, but none of the authors has experience and expertise in X, and they won't admit it. Bad practice is copied to many places. 1000 garbage kill 1 gold.