Hyundai reliability is generally good for first 10 years. After that, the paint and rust effect will build up faster than Japanese car. Personal observation is that it is still better build quality than US car
So if you intent to keep for 10 years, or buy used car, consider how long you want to keep, and sold it before it hit 10 years, see bad paint, or rust build up.
Nevertheless, you can go to body shop and re-paint to remove the rust. Fuel efficiency for Elantra/Sonata are almost the same with similar engine size Japanese car