There are several articles floating around dev.to on this very topic. I'd definitely recommend that you search them out and give them a read, but they can mostly be summed up as follow:
The truth is that it all depends on what you're developing. Front-end web developers technically don't even need what I've prescribed above, but that doesn't mean it's not nice to have. The ultimate goal I would recommend you shoot for is future-proofing. You want a machine that will stick with you, so look for reviews that speak to build quality, and more than just, "It doesn't feel like plastic."
To that end, Apple computers are always a good bet for longevity, but know that you'll be paying the price if something needs to be fixed. Windows and Linux machines are definitely the cheaper route with robust support, but buyer beware; there are a lot of cheap machines out in Big-Box Store World designed for planned obsolescence.
Mac: Macbook Pro 20XX
Linux or Windows: Thinkpad T4XX
Where XX is the latest-model-MINUS-ONE-OR-TWO, which saves a bit of cash.
If you have to ask what laptop you should use, then you don't really need the latest ;)
But really, as long as it has at least an SSD and 8GB RAM you're good.
The surface laptop looks promising too
I'll be honest, I was first very skeptical (I am a mac fanboy through-and-through) BUT I took a honest look and those specs are impressive.
I would still not personally recommend them, just based on the anecdotal evidence of my friend who has had to send in his Surface four times for issues.
You'll definitely want to get the 256GB SSD and the 8GB of RAM. The i5 option would be sufficient.
Again, if you're going to need i7, you're probably not looking here for recommendations.
The price is a little high (but so are my recommendations), but I think the real clincher would be how good the keyboard is (assuming it's not just docked 80% of the time).
I recently did some shopping around and ultimately settled on a refurbished 2016 MacBook Pro. Mac is the OS that, in my world, gets the most attention from developers in terms of good software built, and the 2016 refurbished seemed like a better overall value than the 2017 edition.
I was pretty used to the existing Mac universe though, and that definitely helped. Might not be the same if you're not already used to it.
I have a Macbook Pro and VMWare Fusion. I can therefore develop my web stuff in Eclipse on MacOSX, build my windows code in Visual Studio within Windows 10, and cross-compile stuff for Linux - all on the same laptop. I just swipe left and right to move between Operating Systems.
With an SSD and 16Gb of RAM, the fan doesn't even come on when running 2 VMs and OSX!
If you're not afraid of using Linux, I would check out System76. I got their Lemur laptop last December.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.