Tankless cannot be exposed to more than 11 grains hard water, and must be delimed each year to help maintain efficiency, regular maintenance is recommended to avoid error codes, DIY repairs are not possible, parts are expensive, warranty is not 20 years as promotion frequently says, DIY installation might void product warranty …
For gas: venting is significantly different than typical tank heater, must be connected to 3/4″ gas line with 1″ gas line within 10′ / tankless consumption of fuel can starve other gas appliances of fuel. Expected $4-8 saving per year vs tank-type is not worth the cost of possible repair bill.
For electric tankless: whole house tankless can require new electric service with 250-300 amp. Tankless electric estimated to cost $100 more to operate per year than tank heater.
Tankless electric is useful for individual bathroom or shower.
I recommend avoiding tankless products otherwise.
Generally tank-type heaters can be maintained to last almost indefinitely, and can be repaired DIY without expensive repair.