Unfortunately, you stated no goal, so there is nothing to 'give up' -- learning programming is about setting goals and completing them. Right now, I've'nt got a clue what your goal is -- state it and we can help.
I guess this is rather personal, but that would have been terrible advice to me. Ive been hung up on completing things in the past; but after I realized I do this for nobody but myself, I stopped torturing myself (that is, until i got a job that consist mostly of programming, but luckily I have loads of freedom there too). If you are doing this as a hobby, just follow your fancy and do whatever feels fun in the moment; who cares what the end result is? And when nothing feels fun in the moment, programming wise, thats when you should go play a game or do something different altogether. When nothing feels fun in the moment, period, thats when you should consider if you are depressed or not.