Solar energy is clean, environmentally friendly, and you can basically place them anywhere - mountains, oceans, any windy place is fine. It may not be fast and it can't generate a lot of power, but it's definitely more reliable than solar panels. It's one step closer to having a clean environment.
It depends which country or which part of the world you are in. Some countries have more sun than others. It is a similar case for wind energy. Some parts of the world get more wind than others. I live in the UK and the government are investing millions of pounds into wind energy and wind turbines in the sea and on land.
Speaking on Earth, yes wind and solar are viable sources of energy. However it would need to be a wide network and I don't believe we could only function on solar and wind ( See Geothermal and Nuclear ).
Speaking not on Earth, yes solar would be a very important energy source. Space stations, moon bases, maybe a mars base! However I'm sure nuclear energies will also be very important up in space.
In many places in the world solar energy is far from ideal, however in many places the climate makes solar very easy to use (dry, inland areas) but usually the necessary infrastructure is not in place, as the same climate that makes solar very easy also lacks valuable economic resources. Also, solar cannot be used as the sole source of energy, clouds can and will make solar energy less than 100% reliable in any area.
Therefore it is hard to determine when the sun will be available again, necessitating the overbuilding of solar plants, increasing costs. Solar also requires a large amount of mining and therefore depletes resources useful elsewhere such as computers and televisions. There are also energy sources that are already developed that are CO2 emissions free such as nuclear energy, which is proven to be both safe and economically competitive with natural gas.
WIth mother nature being the way she is, solar will never be viable because it will always cloudy sometimes and when it's cloudy often in winter no solar energy can be produce which can lead to another energy shortage problem worse than anything that solar or wind energy could solve.