With the vagaries of the weather and growing conditions here, I am and have been promoting container gardening for most vegetable crops. Almost every day the weather reports that the UV rays are in the extreme level. My lettuces and other greens may look fine in the morning but by mid-afternoon, they have a bad case of the droops. My solution is to move them indoors and grow them as house plants adjacent to a window that seems to provide enough ambient light and UV rays that they do just fine.
My swiss chard plant (acelga) shown in the attached photo usually produces enough leaves twice a week to be part of a meal or recipe. I would not try this with corn