I would recommend a mixed strategy. There are two sorts of books that are appropriate for e-books, I think. The first category is books that you need now, but wouldn't intend to keep. This includes books in subjects that are less important to your main objectives. In the US, at the undergraduate level, it might mean books that are required in subjects other than your major subject. The second category of books suitable for e-books is those that you expect to always be available in some form over time. Great literature and philosophy are in this category. But if you would intend to discard a book after a year or two, the cheapest alternative is likely appropriate.
I don't have faith that the e-book formats and their readers will continue to be available in an upgradeable way. Suppose you have a very important e-book that depends on some particular format or device and the company supporting that format decides to abandon it. You may not have access to those bits in 20 years or so. That is especially the case for those with DRM "protection."
So, the category of books that you should consider getting on paper are those that are most important to your goals. If you study CS, that would mean the books in the core areas at least. If you later want to refresh your memory those books will still be on your shelf (with reasonable care, of course). You will be familiar with them. Perhaps you have personal annotations in them. For e-books it may be easy (should be easy) to annotate in place, but I don't think that is universally done at this time. So your notes may be separate from the text and it is up to you to keep them synchronized and harder for you to review.
Of course, for such important books, you might consider having both formats, an e-book you can carry on your daily commute and paper for serious study. Some books that you purchase on paper also give you automatic access to an electronic version, or at least to additional electronic resources at no cost.
Note that one advantage of e-books is that some of them at least are updated with corrected versions and new editions. Some of these are at no cost, I've noticed. That is an advantage you don't get with paper.
On the other hand, I still have, and occasionally reference, important books I used as an undergraduate in the 1960s. I also have some of my hand written notes from then and through graduate school. I haven't had to worry about obsolescence of format or device. Some of those books are classics that went out of print and the replacements are not of the same caliber.
You should note that the paper text books you get from established publishers in technical fields will probably only be published for a few years. Text book publishers value the new over the old. If that happens to e-books then you become especially dependent on the devices you now own, but which you will likely want to replace in a few years. It isn't especially costly for a publisher to continue to make old e-books available, but they need to take the trouble to do so - as well as the trouble to update formats as they change.