It's always a personal preference and I understand that sometimes it does take away from the photo. You can always edit lens flare out of photos in Photoshop, but if you want to avoid in the first place there are a few things you can do:
1) Use a lens hood - this blocks the stray light that comes into your camera which may amplify a lens flare.
2) Don't use unnecessary filters such as UV filters, as they will create more sun/lens flares.
Other options include understanding the position of the sun to avoid catching a flare and investing in a better quality camera/lens. However, if you feel that the lens flare is due to the dirt and dust on your lens, you should use a micro-fiber cloth to clean your lens. If the dust/dirt is on the inside of your lens and camera, then that is a bigger issue and needs special cleaning.
Sometimes lens flares are unavoidable so editing is your best option,