My work is being used without acknowledgement
If as you report, it is a clear ethical breach. It should be mentioned to his professor. But you will want proof of the case, such as your old codes or emails via which you corresponded. 

The reasons for not doing this are largely political, if you need a relationship with this prof (or the student) and think this will jeopardize it. 

But if  you want acknowledgement only, perhaps telling the other student that you plans to make a class for plagiarism with his professor may be enough to get him to behave better - at least this time. You could even send him the paragraph of acknowledgement that you would expect him to include. 

However, be careful here to avoid any claim that might be construed as slander. In making the case talk/write about what you contributed without characterizing his behavior. Just the facts, not accusations. If he refuses to do the right thing you could, perhaps, simultaneously send a case file to him and the professor.