Tankless (on-demand) heaters only heat water as you use it, cutting standby energy loss and lasting up to 20 years. Traditional tank heaters cost less up front and handle simultaneous high demand better.
For a small household with steady usage, tankless usually wins on lifetime cost. For large families with peak-hour demand, a well-sized tank can be the more practical choice.