For your reference, I am currently using a XPS 15 (Model 9550, 2015-Now) and a MacBook Pro 15'' (Early 2013, 2013-Now). I'd consider my MacBook my daily driver for coding while the XPS 15 my video editor and gamer. There are different issues that you may need to consider before buying Windows / Mac laptops. For Windows laptops, the main drawback for coders is the PowerShell or CMD, as they simply does not work so beautifully as Terminal on a Mac or Linux OS. You can always find alternatives to it, like installing Linux on Windows or Linux as your second OS, but this way switching operating systems would be a pain. For Mac laptops (MacBook Pro primarily), hardwares are the ones you cannot customise, and almost certainly that one or two of them will not work properly (hearing about thermal issues, keyboard issues, charging port issues... etc.) (my MacBook has got an uneven keyboard to type on and a short-lasting battery, which I fixed with a professional toolkit plus some spare parts I got from eBay). In the end, MacBooks are more of a productivity machine that works beautifully and satisfying (when it works), and Windows PCs are creative machines that you can customise to your needs, and are cheaper (specific models have specific features). If you cannot conclude which you are going to buy after reading this short post (most certainly you don't), trying searching for keywords like "A vs B", "pros and cons of A, B".
If you'd like to have a short reply, I'd say yes, as long as your code does not need that much of computing power. (E.x. To run some of the power-intensive MatLab calculations, I had rent a server on Google Cloud for its computation power)