My logic opinion is that you only need them guns if you can not dive. U-boats were not meant to be fighting aircraft. When they contact one , they normally crash dive immediately, and change course once submerged.
But for target practice, I guess you need them.