Overcoming depression when you read or study

Remember that while you are studying at home or reading a book, you could fall in a state of depression. It happens to me sometimes, and I remember when it takes more than two weeks!
You begin reading with happiness but after some hours or just minutes, your happiness fades out. If this happens to you remember that you are not the only one, but you are among many other people including successful ones. I am writing this now because right now I am depressed. I was reading a book about PHP programming language and as I advance in reading, I find many new concepts with which I am not familiar.
depression
I think of giving up and stop reading, but at the same time, I know that understanding PHP would add a value and change something. I know that if I know how to program I would not have to rely on any programmer or engineer. I would take care of my business myself. Although I know that I will always need help from others, but knowing more means less relying on others.
Anyway, whenever you get depressed, put the stuff aside and take a break or even go outside and enjoy some fresh air and see "how it is outside". Try to watch a comedy movie, meet a friend and talk to him/her. Do not go backward, but keep fighting forward. Do not let depression takes over you.