I did all of that on an M1 MacBook Air and now on a M2 without any problems whatsoever. Only caveat the Airs have is that you can't attach more than one external screen without some workarounds[1]. If you don't rely on that the machine should be more than capable of what you're looking for!
Yes. I usually change laptops once every say 6-7 years. This is why four years ago I decided to buy a maxed-out 16" MacBook Pro with 64GB so that it should keep me for at least 8 years or more.
>I don't see how more ram would extend the lifetime? Isn't there other factors that matter more?
Because RAM is the hard cap (if you ignore SWAP) while here's infinite number of CPU cycles. With a slow CPU things will just take a bit longer, but with not enough RAM then that's it, it's game over for your workloads (again if you ignore SWAP which I don't want to rely on, especially on a system where SSD is soldered).
I just assume web development unless stated otherwise. As an embedded engineer I understand where you’re coming from, but for a lot of people here web is the only thing they know.
I doubt there isn't already enough information and options online and via HN search about M2 Mac's used for development.