Coding from scratch a simulation that you knew the result does help in train you how to debug your code, which is very helpful in indirectly allowing you to understand more how a certain programming language works
Back in my honours, I use MatLab to code a spectroscopic analyser for analysing my spectra. Thoughout th process, I can easily see how and where the code gets wrong