A horse or an assembly line worker do lots of repetitive work. A programmer does lots of non-repetitive/creative work. It's a whole different game. There are examples of creative AI but it is clearly inferior to humans in music, painting, poetry, translation and many other tasks, while in programming it's completely incapable as of yet.
Maybe if conversational agents become good enough to replace lots of websites and apps - that could make a dent. Yet chatbots are quite limited today and in the next few years. It could take 5-10 years before they can be good enough to threaten app makers, and in the meantime there is a glut of unused apps.
The largest threat to programmers is Wordpress, Facebook and Ebay in my opinion. Instead of paying for a new website, Joe Business Owner would suffice with just a FB page or a Wordpress blog. Instead of making an online store, he would prefer being a simple Amazon or Ebay reseller.