Code can be beautiful or ugly but that doesn't make it art.
Art is not just about beauty, it is about expressing the mind (feelings, experience etc) of the author. AI will never do that (except if it learns to express its own experiences, which would be art, but not something competing with human art; it would be like if we had contact with alien art).
I think that's the main thing many people who've never seriously made art or aren't deeply involved with it on an emotional and psychological level are unable to grasp.
I think most of us agree that writing code can be expressive. But I don't think that alone qualifies you code as art.
I have written code myself that I deem beautiful and expressive. But I'm also a musician, and making music (and listening to it deeply) has given me such intense, mystic experiences, that they dwarf anything I've ever experienced writing code. It's also much harder to make good music because it requires a kind of courage and psychological constitution that is simply not required for writing code.
I respectfully disagree, I think code has always been more of an art than a science. It's an odd one, I'll grant you, as you need to do a lot of work to really appreciate it.
Art is not just about beauty, it is about expressing the mind (feelings, experience etc) of the author. AI will never do that (except if it learns to express its own experiences, which would be art, but not something competing with human art; it would be like if we had contact with alien art).