A swimsuit is a garment used for swimming, sunbathing and beauty competitions as costumes. Swimwear has different names such as bathing suit, swimming costume, and swimming trunks (for men).
As for me, wearing a bathing suit in public makes me feel ashamed. Don't get me wrong. I am not used to wearing it. But it is a prerequisite to follow the proper swimming attire. I doubt it if you like to wear trousers while swimming your hearts out.