Really depends on what you want to build.
For iOS/OSX apps you'll need a mac as Xcode only runs on OSX.
Android - it doesn't really matter, Android Studio runs on both Mac and Windows.
Web - again it doesn't matter too much, you basically need a text editor and a web browser. You do get to test on Edge/IE if you use windows.
For actual UX and UI it really depends on the tools, if your looking at working with mostly the Adobe suite you can probably get by with a Windows PC.
A lot of the designers I've been working with recently have been using Sketch
https://www.sketchapp.com/ which is also only availabe on OSX. There are some Windows viewers but I've never tried.
For me I stick with OSX when I'm programming as I can't really live without Terminal. Windows does have ubuntu but there it's just not the same for me.
I spend almost all my development time in either a terminal or in a editor. If you're building web applications, your server is most likely going to be UNIX based as well. It's easier for me to install all the tools I need and configure it how I like on OSX.
Some people live with Command Prompt and Powershell as that's what they're used to too. When I develop on my Windows PC, I usually run out a virtual box with Ubuntu. I am really interested in how Ubuntu matures with Windows though and if they can offer a similar environment without the need for a virtual machine.