OP, please specify which era and region, or even better, the war (or even battle) you're referring to, for example: Ancient Greece, the Napoleonic Wars, the Vietnam War... Thanks!
I just linked to this thread on ancient battles in response to another question. In the first paragraph of the linked post, u/Iphikrates explains briefly why such media depictions are incorrect.
(At this rate, I should ask to get my flair replaced with "Iphikrates' secretary' or something...)