From a C.S. perspective the biggest difference is the extra P cores in the M2 Pro, which will be handy for multi-threading, distributed builds, Docker, etc. The active cooling in the Pro will also be helpful for longer running processes, but that’s unlikely to be a significant issue until later in your career and comes with the cost of the higher weight/thickness.
However, either of these will be more than fine for college courses so something you should consider is how you intend to use it during and after college. For example, If you’re planning to go work at a company, they’ll provide you with a laptop for your work and require you use it. If you’re like most devs, that means this device will be used for recreational development and learning, streaming, gaming, etc.
On the other hand, if you want to start your own gig (e.g., become a consultant/indie dev), then you’d probably consider using this until it becomes cost effective to replace it, in which case the Pro will have the longer life span.
Personally, while I love the form factor of the Air, I’d get the Pro if this was my only computer because:
1. HDMI makes it trivial to use for entertainment/presentations
2. While it’s 16% more volume and 9% more mass than the Air, the extra P cores, better speakers and better screen (especially for outdoor use) are worth it