That, would be the "Phalanx formation". A highly effective against
advancing opponents while providing excellent defence.
Yes, that formation is effective because there is a long line
of combatants in the shield formation. It was so effective
that losing your sword/pilum could cause some minor reprimand,
but losing your shield could mean death penalty.
However, this is only effective if every combatant has shields
in _both_ sides. Not really a small-group tactics, definitely
not that effective with 1-2 shields.