One of my colleagues is helping me on a project, as he has prior experience with such a project, and the product is pretty new for all involved. I asked him about small doubts I had during the functionality stage. However I am able to code and make the project work. He is so annoying these days when he tries to poke into my system to check my code. He says that he just wants to make sure that he is not giving me bad advice. He comes to my workspace and starts conversations. During the conversation he will grab my mouse and switch between tabs to check how I have coded which I find very annoying. I am very thankful for his help but I don't like his actions. How can I politely express my concerns to him?
Implement a Concurrent Versioning System:
Does your company use a CVS system like Subversion, TFS, or Git? My co-workers and I commit our code often (usually several times a day, as we complete project tasks).
Formalize Code Review Processes:
We routine check each others code in the Code Vault to ensure it's readable and maintainable, since any one of us could be called to repair issues during the product lifecycle.
We also use tools within our environment to explicitly send code to one-another for private feedback and code reviews.
I love it when my co-workers all are familiar with a project. It's frustrating as you move on to the next project to have to jump back and fix something because you're the only guy who knows how to fix it (and it's irresponsible to do that to your employer).
Protect Your Employer's Investment:
I'd encourage you to help your company move towards more formal code management.
Although I agree his behavior is bit overbearing, rude, and a personal invasion, You don't own your source code created while at work, your company does.
Who knows, you may get some great visibility in your company for encouraging them to go down the path to development excellence.
And the obligatory office friendship:
I would encourage you to speak with him, and tell him that his behavior is invasive. I'd hope he'd understand, and start using the Vault to protect the corporate assets.
If he wants to check version control and see your code for himself, that's fine. However, coming over to your desk and invading your personal space by grabbing your mouse is completely unacceptable.
I have a couple of suggestions for you which may work:
Locking Your Workstation
The absolutely simplest way to deal with this behavior is to lock your workstations before you turn around to speak to him (WinKey + L).
This sends a pretty clear message that he interrupted you, and that what you're doing is private. The reason I mention this as being the simplest way of dealing with him is because it sends this message without your having to say anything at all.
Bring Up A Different Window
Another thing you could do is open a different window and cover the programming IDE up before turning around to speak to him. For example, as he walks up to chat open up a fresh copy of Chrome and full screen it.
The problem here is that he may still try to grab your mouse and look at your work, so you're not really preventing his behavior, just giving him a subtle hint.
Speak to Him
At the end of the day this person may not get it unless you throw it out there:
Excuse me, I was doing something before you walked up. It makes me feel very uncomfortable for other people to use my mouse, and to poke around my workstation.
At that point you can't be any more clear. If he tries to justify his behavior simply hold your ground:
I understand what you want to accomplish, but if you'd like to see the code maybe we should set up a review session, or you can look at it after I submit it to version control.
I'd just keep my hand on my mouse, and if that didn't work I'd just tell him/her to stop with varying degrees of politeness depending on my relationship with them.
But if someone is continually annoying me, I just tell them that, they usually get the picture although they might cross me off their Christmas card list.