There are probably two different kinds of visits people will plan.
1) Staying only in Barcelona.
If you plan on staying in Barcelona only, look for accommodation around a metro stop.
Avoid touristic places though, Gracia, Gotic, El Born are great places to visit and have a night out, but not so much if you want to have a good night of sleep.
In general all public transport is pretty good.
Metro is a good way to travel around Barcelona with most sights reachable with one change.
Metro trains are air conditioned but metro stations are not.
If you want your own transportation I would not recommend a car to move around. Renting a moped is your best choice.
Trains within Barcelona and surroundings :
http://www.fgc.cat/eng/index.asp
2) Staying on the seaside.
If your ideal rest is just relaxing on the seaside.
Most of the seaside towns within reasonable time from Barcelona are connected via railway.
Rail is actually a pretty good way to make a day trip to Barcelona or other towns around. Trains are frequent and with air conditioning.
I'm mostly familiar with the coast north of Barcelona.
https://www.google.be/maps/@41.1891702,1.6436017,13z?hl=en
but Maite recommends this portion of the coast for people who want to enjoy seaside and visit Barcelona:
https://www.google.com/maps/@41.4948809,2.3466219,14z
Info about trains:
http://www.renfe.com/viajeros/cercanias/barcelona/index.html