Sheikh Khâlid al-Mushaykih, professor at al-Imâm University, al-Qasîm branch
The question of whistling is a matter of disagreement among scholars. Some scholars have deemed it to be something disliked, on account of Allah’s saying: “Their prayer at the House (of Allah) is nothing but whistling and clapping of hands.” [Sûrah al-Anfâl: 35]
This verse, they argue, is a condemnation of clapping and whistling.
Other scholars have disagreed. They are of the opinion that whistling is something permissible. They argue that whistling is simply a habit or a customary practice and that the verse is only condemning whistling as part of an act of worship.
I would say that it is better for a person to avoid whistling.
Ibn `Abbâs, the Companion, commented on the verse “Their prayer at the House (of Allah) is nothing but whistling and clapping of hands.” He said: “The tribe of Quraysh used to go around the House naked, whistling and clapping their hands.”
Another eminent Companion, Ibn `Umar, mentioned that the idolaters “used to place their cheeks on the ground and would clap and whistle.”
And Allah knows best.
Source: Islam Today