"Learned riding" is grammatical but feels a little clunky. I suspect it's because we expect to see "learned [noun]" or "learned [to verb]" and, while "riding" can certainly be used as a noun, it's most commonly a verb when it's used on its own: you'd normally specify what you were riding if you were using it as a noun (e.g., "horse riding", "bike riding", etc.). In contrast "He learned programming" does sound natural because "programming" is commonly used on its own as a noun.
So I would say that "Ever since he was five, he learned riding" is OK but "Ever since he was five, he learned to ride" or "... he learned horse/bike/camel riding" would be better.
Even better still is "... he has learned", since the phrase "Ever since" implies an action that began in the past but is continuing into the present.
Well, after doing a lot of digging around, it looks like there really isn't a specific rule for this because there is little to no difference between the two. I think that the comments on your question confirm this...plenty of native speakers can't seem to find a distinction between the two.
So it looks like the "to" is completely optional. What is strange about this is that there doesn't seem to be much of a connotative difference between the two versions at all. Usually when something is optional, the different versions have some sort of connotative difference - possibly more formal or more colloquial. It doesn't seem like that is the case here to any extreme degree.
Both sentences below have the same meaning:
My goal here is to help you to learn to think in JavaScript.
and
My goal here is to help you learn to think in JavaScript.
I will say that I personally prefer the second option without the extra "to." I think this may be because the to-infinitive sounds slightly more formal, and in this case, since the writing style and topic seem on the informal side to me, leaving the "to" out (using the "bare infinitive") makes more sense to me.
BBC World Service's page on learning English confirms this:
The difference is one of form only. There is no difference in meaning.
to-infinitive or bare infinitive
Help is a verb that can be used with or without to and with or without an object before the infinitive. When we use it without an infinitive it sometimes sounds more informal. Compare the following:
Could you help me to look for my car keys? I can't find them anywhere.
Could you help me look for my car keys? I can't find them anywhere.
Would you like to help to cook dinner tonight? It's late and I'm feeling tired.
Would you like to help cook dinner tonight? It's late and I'm feeling tired.
Here are a number of links that you can check out for more info on this (that appear to confirm what I've written above).
Best Answer
"X is important to learn" would mean that it is important that you learn X.
"X is important to learning Y" would mean that in order to learn Y, X is important. In this case, in order to learn about what will help farmers use wet soil, the scientific work on crops in standing flooding is important.