We use electricity for two purposes: transporting energy and transporting information. Running complex programs depends on transporting information. It is already possible to make optical computers, and it is not unlikely that these will be more common in fifty years.
Using light to transport power is less likely. Suppose instead of an electric cable, all the power to your house was provided by an optical fibre. For this to work, all your household appliances would need to be light-powered, and I don't know how you'd go about building a light-powered toothbrush, for example. Also, if the optical cable were to break, you would have a multi-kilowatt light beam emerging from the broken end; this would be a dangerous weapon.
Perhaps a more likely alternative to electricity for distributing power might be hydrogen -- imagine the mains cable to your house being replaced by a gas pipe. You burn the hydrogen for cooking and heating. All of your household appliances contain a small hydrogen storage vessel, and a fuel cell. You periodically refill them with hydrogen, the fuel cell converts the hydrogen to electricity and water, and the electricity powers the device.