Why does he ask you?
He could be asking you for a variety of reasons. Each will have a different way to deal with them appropriately:
- He is legitimately stuck and you're approachable
- He is a help vampire
- He is looking for someone to defer responsibility when something goes wrong
Generally if it's case 2 or case 3, you shouldn't waste your time (company resources) aiding a horrible habit. But perhaps you're the type of person who can't say no. If that's the case, the following tactic will likely work for you regardless of the reason he's asking.
Give a Man a Fish...
This is the wrong way to help him:
You should encrypt values before sending it to the UI
This teaches him absolutely nothing. It tells him what he should do, but not why he should do it. Here is a parable to demonstrate the principle from another answer:
If you ask me what the current rate between JPY and USD is, I can tell
you (about 95 JPY/USD). If you need to know the same thing again next
week, or next month, and I'm not around, what will you do?
It may be efficient in the short-term to just tell you to use 95, but
long-term if an important part of your work is knowing what the JPY to
USD rate is, it's much better for me to teach you how to figure it out
rather than just telling you the answer.
Now many people may assume this means I should just give you a link
and then it will all be okay because you can find it next time.
Problem solved, right?
What happens if you need to know the rate between USD and EUR? What
will you do then? Of course I can give you another link, but then you
will just have two separate links, and run in to the exact same
problem if another currency is required.
If you guide him through the thought process, rather than just giving the answer, it will have the following effect:
If he is legitimately stuck
It will give him a tool on how to think through the situation on his own, and help him ask fewer questions in the future. You win. He wins. The company wins. And you look like an awesome mentor, which is always good.
If he is a Help Vampire
It will get him to say things like, "Yes, but what's the answer?" or "But I don't have time for this?" in which case you can easily see that he is just mooching off your brains to do his job for him. I would respond to future requests with something like this:
I'm a bit busy working on a project right now, but if you absolutely need help would you mind running it by my boss first?
If he is a responsibility-evader
It will get him to say things like, "What would you choose?" or "Is it okay if I...?" in which case you can understand what he's after. I would respond to future requests with something like:
I can tell you what the concepts are as far as I understand them, but for the specific requirements you'd be better off discussing it with your boss.
The Curse of Competence
The problem with competent people in virtually any workplace is that they think the ability to do more work is a universal benefit. "I can do it better than they can, therefore I should do it" is going to come to bite you in the end.
You can either view this as an opportunity to become a better teacher (rather than a supplier of results), or as an opportunity to become better at saying no. Don't just blindly do whatever work is thrown at you -- with great competence comes great responsibility to use that ability where it will have the greatest impact.
Wasting your time on help vampires will end up having people call in to question your judgment, rather than have people congratulating your talent.