I think the OP was after a laptop, in which case I'd say shell out for a MacBook Pro and remember that you're getting something that should last for many years. There are no cheap Macs, not even ancient ones, but they are usually pretty durable and Apple has a good record of supporting older hardware (though see below).
I've also heard it said that Macs are scarcely more expensive than Windows machines of equivalent spec. People with Windows experience can judge that better than I.
Watch out for the dreaded "butterfly keyboard" on some recent Mac laptops. The key action feels horrible (that's a personal judgment) and they are prone to breaking.
Some of the slightly older MacBooks have just one USB-C port, so you'd probably need adaptors. I believe the newer ones have more ports.
I have a 2015 MacBook Pro and it's a cracking machine. Two old-style USB ports, HDMI, Ethernet via a £20 adaptor, and power via the excellent MagSafe plug.
For an affordable desktop machine, yes, track down a vintage Mac mini. I’m writing this on a 2011 mini with a DIY SSD upgrade, and my wife uses a 2009 one. Neither of these officially supports the latest macOS (10.14 Mojave), though there’s an excellent installer patch that I’m using to run this on the 2015 mini. I expect the patch will be updated next month to support the forthcoming 10.15 Catalina, but I don’t think I will take it any further.
The mini has a strange history in terms of form factor, specs and pricing. The 2015 mini cost about £500, so it was pretty affordable. It's fiddly to work on (to add an extra disk) but it can be done, and the RAM is easy to get to. Later models were less easy to upgrade. The current (2018) mini is a powerful machine with a price to match – £2000 or so with a big SSD.
iFixit is a great resource for upgrades.
I've owned four generations of desktop Macs and most have been very long-lived. The first flatscreen iMacs suffered badly from capacitor rot but I hope those days are behind us now. Still, at least they were easy to work on. The newer iMacs are much harder to dismantle, so personally I'd avoid those.
If you need to compare specs,
Mactracker is a wonderful free database of all the devices Apple has ever made. Though you ... err ... need a Mac to run it on.
As others have said, I'm sure Linux is a great alternative if you can find the software you need. The Unix underpinnings of macOS are also helpful if you need to run some Windows stuff. DSLstats runs in Docker on macOS, for instance, and RouterStats runs under Wine.