What is the purpose of characters shouting out the name of their attack? It seems to me that in a lot of anime (Naruto, Dragon Ball, Gurren Lagann, and Digimon are four that come to mind), characters or creatures who perform an attack tend to shout its name, almost as if necessary to perform such an attack. This seems very counterintuitive—telling your opponent that you're about to use a fireball would open you up to being blocked very easily.



Why do anime characters tend to shout the names of their attacks? (Bonus points: Has this spread into Western animation?)
According to this forum post:


  It's a tradition where it was intended for young audiences to yell the attack names with the character. The tradition began with Mazinger Z, which is considered the first Super Robot anime. The producers of the show felt that if the main character, Kouji Kabuto, shouted out the attack names each time the mecha did them, then it would give the target viewers, who were aged around 3 to 10 at the time, the ability to literally join along in the fun.
  
  The logic behind this is if the kids were to directly interact with a show they already liked, then they'd like it even more and would stick with the show in the long run. Needless to say, the strategy worked, and literally all other mecha anime in the 70's (sans First Gundam in late, late '79) copied the trend.
  
  Thus, the tradition was born and still anime shows, regardless of whether they are mecha themed or not, use it, regardless of their target audience. 


Also, It seems that it was also done to make the shows feel more intense. Something about the characters yelling their attacks just makes the action better. 

Usually it's hinted at that the characters are only calling out the attacks in order to channel energy (much like how the characters in Harry Potter have to say the incantation for a spell in order to cast it), because if the attack names are removed then it will just be a bunch of grunts.. which seems pretty boring. ;)