The act of creating art is a means to an end. It doesn't keep you up when you're down, it doesn't check in to see how you're feeling; creating something is often emotionally draining. You have to dig deep inside to create something, take the risk of putting it out there in front of others, be vulnerable, realize that your first attempts won't live up to your expectations, that the real work begins once you start editing and refining... and the final result may never be what you initially imagined; and so you seek to put yourself through it again, one more time.
Don't fall in love with this process! It's way easier to remain impartial and you will retain a lot more of your creative energy when you do. You will be able to take constructive criticism and be more productive with it. It will help you refine your work and get closer to that ideal form you envision.
Programming is very much a creative endeavour. It has similar ups and downs. Don't fall in love with it!
It seems to me that you're not giving up on programming but perhaps are not enjoying something about the process. It could be the tools! It could be that you don't see that what you're building is worth the effort. Maybe you need a new project? Maybe you will enjoy embedded programming or systems programming more? Maybe there's some problem you would rather be working on?