I had a cheese-grater Mac Pro G5 for 8 years that still worked beautifully when I gave it away. I did upgrade memory at one point. An external display had a power supply problem after a few years. I replaced the graphics card. The ability to replace parts does help but I’ve also had a MBP since 2013 that has no accessible parts that also works fine.
Of course, on the flip side I’m grateful for this reliability because there’s no way I want to replace my 2013 MBP with any current Apple offering. They’ve truly screwed their product line and I figure I can only wait one more generation for them to come up with something sensible.