According to Buddhism, the most important thing is the mindset of the donor. The detachment the value from the donors mind. Not important you do it in silence or in public.
The act of giving can have several mindsets.
01. The giving happens as a belief or as taught it as a good thing. In this case, donor caters to his belief. Or for ego.
02. This situation has link to first case. When you see someone need something, you feel sad inside or become uncomfortable. To overcome the sadness you act accordingly. Example : when someone request money for food from you the other persons hunger create sadness in your mind. To overcome your inner sadness you give money to buy food. By this, you are helping yourself. This can be case easily identify. How? If you get angry when you get to know that, the person used your money not for food but for something like illegal substances such as heroin. This happens because of your sadness created by the need of food but not the need of illegal substance. Then the sadness feeling turned in to anger because the other one cheats you.
03. This case, use the opportunity to detach the value of the thing from your mind. If we use the example of the second case If someone ask money from you to buy food you can simply give the money and you don’t care at all how the other person going to use that money. Also giving money or not does not make any difference to you. As an example if you are not in a position to help, you can simply ignore it without any guilt or sadness.