You will get out of your education what you put into it. This doesn’t just apply to Computer Science, but it applies to education in general.
Over the course of your education, you will complete many programming assignments. You can approach these assignments in one of two ways: you can either do the bare minimum you need to complete the assignment and pass the class, or you can see these as opportunities to learn new skills and start practicing the profession that you want to eventually have.
What do I mean by this? If you are like many CS students, you eventually want to pursue a career as a software engineer/developer somewhere. If that’s what you want to do for a profession, then definitely start practicing discipline early rather than late.
How do I suggest going about this? Well, take a look at a given assignment and come up with a set of requirements (e.g. “the program shall do this”). For each requirement, come up with a set of test cases such that if your program can complete these test cases correctly, then you can be satisfied the program has correctly implemented that requirement. At that point, you should implement that requirement. Once your first requirement is done, then move onto your second requirement, and your third, etc.
This may seem pretty overkill for small “toy projects” at university, but when you get to the Real World and/or grad school, your projects will be considerably more complex, and learning this discipline early will definitely help you.