Contrary to what some people do out of worry over algae, I normally have tanks near a window or in a room that's well lit by windows that allow daylight/sunlight.
Another possible benefit to sun in tanks is, depending on exposure, you may get a bit of passive, natural UV sterilizing (example reference here).