I have a question regarding weapons in the game.

suppose weapon A gives you a +4 to your strength

and Weapon B gives you a +12 to your attack.

Assuming both give the same damage, is it better to add a +4 to your strength? or a +12 to your attack?

Or what is the correlation between Strength stat and attack bonus?

Thank you in advance your any help