Tuesday, 3 April 2012

5 ways to get around "programmers block"

It has happened to us all.

Everything is going swell. Your program is shaping up great. You are writing line after line of good code, almost on autopilot - then BAM. How do you go about doing that? Let's try using gotos instead of a for loop... nope, that's not worked. How about loads of if loops instead of that switch... nope, not compiling. After a while, this can get really frustrating, and make you feel like giving up. I call this programmers block.

5) Google, THEN ask
Try googling the error code you get, or google a certain function. Look at the first two pages of search results, and if you can't find what you are looking for, THEN ask. I cannot emphasize how important it is to properly search before you ask and waste someones time. If you fail to google properly, you will annoy everyone and just get loads of lmgtfy.com replies. A good website to ask for help is http://stackoverflow.com/ - the community over there is really friendly.

4) Get inspiration
Go to freecode.com or pastebin.com and search for a program that is similar to yours, or has an interesting way of doing a certain thing. Remember, never copy and paste code. You will not learn from this, and next time you come across a similar problem you will become stumped again.

3) Rewrite the program a different way
This can be a frustrating option, but sometimes its the only way. Sometimes you don't have to rewrite the whole program, but instead re-structure it.

2) Get some sleep
This suggestion may seem a little bit strange, but studies have shown that sleeping can help you make decisions. Just sleep, or even forget about the project for a few days - when you next come to the project you may find a solution that has been strikingly obvious, but you never thought about it.

1) Learn more
All programmers are still learning, even the really experienced ones. Read about more functions and library.I recommend buying a book about the language you are writing in above guides on the internet. The books are usually higher quality than a .pdf on the internet as anyone can write a .pdf, but a book must be of a certain standard to be published. Also, you can read a book anywhere, but need a to be in front of a computer to be on the internet.

It is really important that you don't give up. You will feel good once you have beaten programmers block, and it will prove a valuable learning experience for future encounters.

Thanks for reading :)

No comments:

Post a Comment