Hostas can grow perfectly well in both sun and shade, although they need more moisture in sun. They make two kinds of leaf depending upon their situation, so if you move a hosta from shade into sun, the leaf-buds it made the previous year will be for shade, not sun and may result in leaf burn. It also depends on the species, but generally speaking, hostas with blue leaves dislike too much sunlight or just lose their colour and turn green in sun.
As already stated, hostas are principally grown for foliage, and some people cut off the flower spikes since some varieties will pretty much die back once flowered. (these tend to be the big ones) whilst other varieties will have a second growth spurt after flowering and make a new flush of leaves. (these tend to be the fast growing ones) although there are exceptions to these rules.
Flowers or not, sun or shade, they are worth growing however you like
enjoy!