It is generally better to give sadaqa privately, as it is considered more sincere and less likely to be done for show. However, there may be situations where giving publicly can encourage others to also give and increase awareness of the needs of the community.