I don’t have a laptop and I can’t afford one

No problem. You don’t need one.

It is recommended, however, that you buy one. These days you can easily find used laptops in good condition, in good prices and with guarantees of at least one year.

Focus on ergonomics and not visuals. You do not need an expensive laptop to write code. You need a good keyboard, a great screen and an average to above average CPU. Buying a used laptop is a good choice and it is highly cost effective.