I can only speak from my point of view. But I honestly don't think "protecting" your idea matters much. Unless you have evidence proof that someone takes your idea maybe from how you write the code or where the person takes the code from, there's really no way of "protecting" your code or idea. And what makes you think you're the only person who thought of the idea you are thinking now? We're like 20+ years into the
IT industry that practically, everyone has the same idea.
A good and clear example can be
Facebook. Mark was hired by the Winklevoss brothers and they had the idea to connect people together online. And the Winklevoss brothers "thought" they were the only 2 who had the idea of connecting people online. That's entirely wrong.
MySpace was well before their time and
MySpace had the idea of connecting people together as well. Many many many sites are like that and were way before
MySpace as well. So Mark didn't technically steal the idea of "connecting" people online. He had his own agenda and took the opportunity to build
Facebook off of something that was already there. Social networks don't start from "good" ideas or "good" codes. They come from hypes and trends.
So what makes you think that your idea is the only idea that is like that? Everyone has similar ideas with different twists. Nothing is the exactly the same, but have a general similarity. The only thing I would suggest is patent the final product and hope that no one steals the actual product.