You can/should do both. Copyrights are fairly easy and something you can do yourself (for free).
However, copyrights will only protect your actual software code as it is written (and small variations of that code). So for example if Twitter only had a copyright and someone in China saw how Twitter worked and wrote new code from scratch to create a program that did the same thing, then Twitter would not be able to stop him because he did not copy their code directly.
Patents on the other hand protect ideas, methods, processes, etc. so if Twitter had a patent on the process of sending a Tweet to other users, then they could stop other people from making websites that did similar things.
As you can see, patents are a lot more valuable because they protect the idea/process and not just the software code.