Should You Protect Your Code?

I'm on the CakePHP mailing list, and recently someone sent an email asking what product to people recommend to obsfucate their code. The poster in question is going to be distributing their application and I guess he doesn't want them to be able to figure out how the application works or even look at the source code.

I replied asking why he was trying to protect his source code, and another developer jumped in calling my logic "flawed" and going into a fairly long rant about the evils of not protecting your intellectual property and support issues from people who've modified what you've worked on and expect you to fix it for them and a few other things I won't go into here.

Personally, I don't think it's worth worrying about that stuff for more than about 1/10th of a second. If I build something and sell it to people, well, I've got licensing arrangements that prevent you from distributing my code without my permission. I did this with a parser I wrote for Canada Post's E-parcel system many years ago. Did the company in question copy the code and distribute it? I have no idea, but I'm not wasting any time worrying about it.

I feel that if you're obsfucating the code and then selling it to people, you're saying that you don't trust your own customers. That's a very dangerous business practice. People reverse engineer how things work all the time without access to sources, so there are bound to be people smarter than me who figure out how my stuff works without asking me for the source. I'd prefer to trust my customers and continue to produce high-quality code. It's not the code that's worth the salary I'm being paid by my current employer, it's my knowledge on how to create the code.

As for the support issues, well, I guess people aren't as straightforward as I would be: if you've modified the code without me knowing about it, you're on your own. But I suspect my attitude is very different from most other developers.

Obfuscate your code if you must, but you should be aware what other people will think of you for doing that. Trust is a big issue, and once you lose the trust of your customers, well, you should start thinking about an exit plan.