The Accord is what happens when a company that knows how to build engines decides comfort and space matter just as much as the drive, and mostly nails it. The 2017-2019 1.5T burns head gaskets between 60k and 100k miles, a $2,000-4,000 repair that's common enough to be a known hazard; skip those years or budget accordingly. If you want a roomy, efficient sedan that won't bore you on a back road and won't strand you at 150k miles, the 2.0T or hybrid models deliver, just know the latest generation traded the sharp looks of the 10th gen for something safer and blander.
The Sonata offers sharp styling and premium tech at a price that undercuts the Accord, but the 2011-2019 Theta II engines were catastrophic, seized motors, oil consumption, and rod bearing failures between 60k-100k miles, with dealerships often fighting warranty claims. The 2020 redesign brought fresh looks and the 2022+ SmartStream engines show real improvement, but depreciation still reflects the older models' sins. Walk past anything pre-2020; current-gen buyers get genuine value and a 10-year warranty, but you're betting Hyundai has truly fixed what broke.