Hopefully the new heat pump water heaters are better. The advantage of resistance heating is simplicity and cost, with no moving parts. Solar panels are so cheap now they make it hard to justify the expense of the heat pump, assuming you have room to mount the panels.