I've been let go three times from three different jobs already in the past four years.
The first job was doing seismic interpretation software in C++. It lasted nearly three months. The reasoning was that I had excellent C++ skills but I had serious communication issues. My second job was at a flash social games company. Again I lasted nearly three months, with the reasoning being that once again I had poor communication skills and was slow to pick up the pace. My last job was at a regular casual flash game company. I lasted 1 year and 9 months on this one. The reasoning for my dismissal this time being that they had to lay off staff due to the economy, so they picked two programmers. I was picked because even though I produced quality code, I could not finish it in a reasonable amount of time. My boss told me once more that he thought I was a good programmer and he wouldn't say no to rehiring me in the future if I managed to get some experience in IOS programming, given their interest in moving in that direction.
My concern is that I somehow doubt if I'm even fit to be a programmer at all. Even though I can do some impressive stuff that few people can do (I was hired at my last job because I was able to create a pretty impressive 2D/3D demo in flash from scratch, even though they had already filled the role), it almost always takes me nearly twice as long as anybody else to achieve the same results. Even when I'm doing the simplest tasks, such as typical state machines for character behaviour in a 2D platform game, I feel like my brain somehow freezes for no particular reason. (It's been like that ever since I can remember for the past 12 years or so, but I thought it was something that happened to everyone.) I tried staying late pretty much every day, but still it wasn't enough for me to catch up. All of this was made worse by the stress that built up from knowing how slow I was, wondering if my boss was going to call me that day to give me the bad news. I'm naturally a very stressful person, so I recognize that stress in itself makes me even slower.
I feel like I've lost all motivation and ambition to learn new things, and that I should just give up on programming and simply focus on doing simpler, less stressful things like working at a library or something, and just forget about having a career, because I simply cannot do anything else. Programming is all I know.
So what I'm asking of you is a serious opinion on the matter, given the few details that I've given to you. I've already started looking for a new job, but I'm wondering if it's going to turn out the same. I know I have to be posititve about things, but how can you stay positive when you've failed so many times in such a short time?