nothing is wrong with scattering print statements in your code
but you have more power with the interactive debugger