For the kind of computer science that has an emphasis on big data analytics with complex data sets, the University of Denver, Colorado recommends laptops with 32GB RAM to students (with 16GB being the minimum). So, even though in most cases 16GB should be enough, you should still nevertheless verify how much RAM you will be needing. I.e., if you can't find an unambiguous answer on their website, then contact the university, and ask. You can expect that 8GB is these days almost always no longer enough for a computer science student, or if it still is, then it very likely soon won't be.
Also be aware that "Core i5" is just a marketing phrase that tells very little about the actual CPU performance in question. On average, the Core i5-14450HX performs a little over two and a half times as fast as the Core i5-1230U. Also on average, my Core i7-13650HX performs less than 14 percent faster than the aforementioned Core i5-14450HX whereas the Core i7-14700HX is almost 33 percent faster than this same Core i5-14450HX. So, the difference in performance between a Core i5 and a Core i7 very often pales in comparison to the difference that is engendered by what exactly it is that is written after the hyphen in the Intel® Core™ CPU model name.
While it is true that a faster CPU can help to reduce the time it takes to compile code, having to run the project after it is compiled and having to test the project while it runs may also be relatively high (or not) on the list of deciding factors when it comes to determining how much CPU power will be enough.
Further, the power consumption of a CPU can also matter a lot. How long it will take before the battery runs low is multifactorial. The battery capacity alone is only one part of this equation. A 13th/14th gen Intel Core H-series CPU is leaning somewhat more toward energy efficiency (at the sacrifice of performance) when compared to a similarly priced 13th/14th gen Intel Core HX-series CPU, generally speaking. Even so, the fact that there is no linear relationship between the cost of a laptop CPU and the cost of an actual laptop does complicate things to some degree.
In the classroom, if students are allowed to plug their laptop's power supply into the wall during those times when more CPU power is needed for them to fulfill an assignment or if having only a limited runtime of the battery is not a problem (which it typically shouldn't be, IMO anyway...), then a 16″ WUXGA (1920×1200 pixels, 16:10 aspect ratio) laptop with a 13th/14th gen Intel Core HX-series CPU, a 90Wh battery, and a really pleasant keyboard would be my preference.
I am an Enterprise Java software developer, and, I have a degree in computer science. The laptops that I have listed in my specs are not what I use for work, but I use my Asus TUF Gaming F16 (2024) for studying various computer science related subjects. Unlike most other career paths, software developers stop being software developers almost immediately the moment when they stop studying computer science.