I am developing an Android app at the university where I am getting my PhD. I am also the lead developer for a startup company. Since I am developing both Android apps, there is some crossover in the source code. How important is it to have dissimilar code? Are there any laws about reusing code that I should be aware of? And does this really matter if I am the lead developer (since it may all look the same simply because I use the same semantics and style)?
If you're getting paid for one and hold equity in the other then it's a pretty clear conflict of interest...at least if you write for pay (work-for-hire) and then use that code in your own product to make a profit.
The law often (not always) comes down to what is basically right and wrong. Having someone pay you to write something and then taking that work and re-using it without compensating them is bad form.
If you are employed at the university, even part time as a graduate assistant, there should be a clear cut policy on who owns what, and whether you are allowed to develop similar and competing software on your own. Some organizations claim ownership (in employment agreements) of any code written by an employee, whether "on the clock" or at home.
Other organizations say any code written at work is owned by the organization, and you're free to create your own stuff on your own time. If this is the case with you, you should be careful never to copy code from work with your independent project.
If you are not employed by the university, there should be no such limitations.
Check the rules at your school for ownership of student research. I know of one person who changed their disertation because they would have lost the intelectual property rights. If you don't publish, it may not be an issue.