Copyrights protect form, patents protect function. Copyright comes into existence the moment your software is made, and you don’t need to register until you suspect infringement. Get a patent before you go public. If your software does something new or has a unique interface, consider getting a patent. If the code or visual appearance of your software is original, register it once you suspect it’s been copied.