Programming is *an* art because literally every human pursuit can be an art if done with enough skill and grace. However, programming cannot be appreciated *as* art, insofar as we are talking about programming in its pure form, and not married to other aesthetic pursuits like UX design, because programming occurs in a black box that no user will ever see.
(Again I am talking about programming in its pure form. UX design, video games obviously, etc. are artistic but not because of the programming aspect. Which is to say: to programs can be considered identical from a UX perspective if they achieve the same effect. So clearly the art is in the *design*, not in the *implementation*.)