I've got a 2018 i7 mac mini that I upgraded the ram to 32GB myself and it's a very capable little machine (got it when I needed to do Unity Mobile Game development, but it keeps up with pretty much everything).
I do wish I would have gotten a bigger internal SSD (I bought it with 256GB, but have now moved most of my files to an external SSD and it's a constant struggle).
I've also now purchased an external GPU to drive my 2 4k monitors at home (it can do 2 4k monitors of text editing itself without struggling _too_ much, but it does run about 15C cooler with the eGPU), so it's hard to say if an iMac wouldn't have been a better purchase, but the nice thing about the mac mini is I can easily throw it in a backpack when I need to travel every couple of months.