I bought both 13" models last year for cheap, the Air for my wife for the kitchen and the Pro for my kid for school. Both will get macOS security updates and Safari updates the same length of time (likely until 2024).
Overall, the MacBook Pro is way, way nicer. The huge advantage of the Pro is Retina screen which does much better with small fonts, which would benefit you for programming. The Pro also has more ports, which can be helpful. The Pro is also a bit faster, albeit potentially at the expense of battery life. The Pro also has a smaller footprint. However, there are a few big caveats.
1. Neither support Ventura. Software compatibility may become an issue in a few years.
@redheeler mentioned Xcode, for example. Xcode 14 runs on Monterey though.
2. The 2015 Pro suffers from screen delamination. You have to be very careful when purchasing one because if you get one with screen delamination, it can look bad if there are a lot reflections in your room. It's basically the antireflective coating wearing off. You can remove it completely to make it look good again (with more possible glare in a bright room with lots of windows) but it's a long process, and it's possible to damage the screen while doing it. (The one I purchased has a perfect screen.)
3. The battery replacement on the 2017 Air is dead simple. It's just a few screws and a cable. The battery replacement on the 2015 Pro requires either replacement of the entire top case with keyboard and trackpad (since the official battery part includes all of these things), or else an annoyingly difficult removal of the glued in battery. (Our 2015 Pro had the true top case + battery etc. replacement done by Apple a few months prior to my purchase, so the battery is essentially new.)
I know you have a strict budget, but the 2020 Intel MacBook Airs often go for reasonable prices on eBay. The 2015 Pros tend to be in the US$300+ range for 8 GB and 256 GB, whereas the 2020 Intel Airs go for around $450-$500. In fact, I recently saw a 16 GB 2020 Air with 256 GB SSD that went for less than US$400 here in Canada. In retrospect maybe I should have bid on that one for my other kid, but in the end I decided to wait for M1 models to drop in price. That 2020 Air gets loud with moderate usage according to various people, but OTOH, it has a Retina screen, faster performance than the 2015 Pro, and support for macOS for many years to come.
I specifically ignored the 2016-2019 13" Macs because they have butterfly keyboards which are prone to failure.
That is not correct. The memory cannot be upgraded on either the 13" 2015 Pro or the 13" 2017 Air. On the flip side, the SSD can be upgraded on both of them. The 2015 Pro and the 2017 Air I purchased both came with 128 GB SSDs. I upgraded both of them with Apple/Samsung OEM 256 GB drives, but they can both also take third party NVMe drives. There is slightly more room in the Pro though, so the Pro can take 1 TB Apple OEM drives (which are fatter than the usual Apple OEM drives) but the Air cannot.