I have a laptop from mid-2009 that's still good (it's a white MacBook). The only problem I've had has been the battery bulging and Apple replaced them under Applecare with no problems. The last I had replaced out of warranty for no charge. It's slow, but everything still works. I used it for my main machine until late 2012 (when I bought an i7 Mac Mini) and was my portable machine until late 2013. My Mac Mini has been pretty heavily used since 2012.
Everyone in my department at the university who switched to a Mac has had good longevity, most lasting about 4-5 years until they decide they want a new machine (but the Mac still works). I had two Mac Minis in the lab, one a G4 Mac Mini from 2002 and the other a first-gen Intel Mac Mini (it came with 10.4, I don't recall the year). I used the Intel Mac Mini until I graduated in 2013 and had no problems at all.
So, anecdotes are just that. My department consistently has been moving to OS X. Probably about half the professors have switched when there was just 1 professor who used it in 2007. Even my supervisor didn't switch until about 2010. He's still using the same iMac he bought then. The labs mostly use Windows because of the data acquisition software only runs on it as they tend to have specialized equipment that only wrote Windows drivers.
> I have a laptop from mid-2009 that's still good ... was my portable machine until late 2013.
I don't think this should count as a counterexample. You have switched laptops in 2013, and while there could be many valid reasons for that (battery life, more power for development, your old laptop does not support a new OS) it made you old laptop inadequate -- and hence the switch.
Everyone in my department at the university who switched to a Mac has had good longevity, most lasting about 4-5 years until they decide they want a new machine (but the Mac still works). I had two Mac Minis in the lab, one a G4 Mac Mini from 2002 and the other a first-gen Intel Mac Mini (it came with 10.4, I don't recall the year). I used the Intel Mac Mini until I graduated in 2013 and had no problems at all.
So, anecdotes are just that. My department consistently has been moving to OS X. Probably about half the professors have switched when there was just 1 professor who used it in 2007. Even my supervisor didn't switch until about 2010. He's still using the same iMac he bought then. The labs mostly use Windows because of the data acquisition software only runs on it as they tend to have specialized equipment that only wrote Windows drivers.