For the longest time I've been going back and forth when it comes to test. Mostly because most of the time I'm testing a subset of the program. But as I have been working on building a compiler, I did not even realize that I've barely run the entire program start to finish, it's mostly all just tests. For the compiler it makes perfect sense as based on the code that is input the output is fixed, it has to be as expected. Tests are also the fastest way to test and build parts in isolation. That is, test if the compiler is building the right opcodes before testing if the virtual machine is executing the opcode correctly. At each stage I can completely focus on the task at hand, without ever worrying if I messed up something else as I can use the same line of code for both the compiler and the virtual machine. Also the cost of manually testing is too high and it's the same for print debugging too. It just takes too much time.
Print debugging is how I debug things most of the time as I work with a server and it makes total sense. But when working on the compiler I found that a debugger is way more handy when you are working with byte code and there are just too many branches to print debug.
So in other words I just needed to come across the right problem to be able to find use for tests. This makes me feel a lot better about not writing tests all the time. I rarely write tests on a day to day basis. When I do it's most unit tests to test some core functionality of an API. In other words places where it's guaranteed a given input should always produce the same output. No I/O or network issues need to be considered.
Side projects are so much fun. I'm nearly at the end of the compiler book and will have successfully built my first compiler. It has served multiple purposes. The first was to understand how compilers work and the second was to get better at Zig. I would say the compiler project has exceeded all of my expectations by a huge factor. It feel so fluid to write Zig now, I barely need to go to the documentation as most compiler errors have become obvious and I know what to fix almost instantly. It's a good feeling. It's feels worthwhile all the times I was stuck and felt clueless, yet staying with it and believing that at some point my level of competence will grow feels fucking awesome. This is what I strive for when it comes to my craft. A feeling of competence. I think I know what I want to build next, If only I can find the article. It should be fun.