Depending on the task, you can even get away with a base air lol, im talking M1. If you’re newly learning to code, lol bro, even a 2017 air will suffice… don’t buy that though. If you’re looking at more intensive tasks, than the Pro lineup is pretty open to you, a lot to choose from for sure
Programming involves coding. Hard to recommend anything without knowing what you’re going to use it for. Based on your one-liner, a Macbook Air may even suffice if you’re just going to learn how to write code. Even a 2015 MacbookPro Retina 15" will work great for your needs if it’s just learning and starting out. On the other hand, if you have specific needs (need Apple Silicon or need to handle local LLMs), different story.
This is like saying “I feel like visiting a pretty place in the world. Where should I go?”