Udemy is a website where lots of people can feel free to sell their own courses - this means there are a lot of different courses, not just one web development one. Which is the specific one you bought?
I've done a few Udemy courses and they range from "meh" to masterpieces - it really depends on the instructor! The open nature of Udemy means that there is zero quality control so you can be taking a gamble when you purchase a course, although user ratings can give you a good idea. They're usually worth a shot for something you're interested in when they're on sale (which seems like all the time), but I certainly wouldn't pay the somewhat exportinate regular prices of a lot of the courses.
You can usually access a course preview as well which is reccomended to do before taking the plunge.
You can definitely learn programming from these online courses, I got my start from doing one, although it requires you to be motivated and willing to put the work in. Not all teaching methods work for everybody so you might need to try a few courses before you hit one that's right for you.