Category: Coding
-
Why you should write code that is testable
That doesn’t mean you necessarily write tests for all the code you write (although in a professional setting most of your code probably should have tests). Code that is testable tends to be simpler with less going on. If you can’t write a simple unit test for some functionality, it’s probably complicated. This makes it…
-
How to organize code into different parts
When I first learned to code, I wrote all my code in a single file. I didn’t even use functions. For example, let’s say we had a simple application that allowed the user to enter in some todos and we wrote it to a file when they were done. My code would look something like…
-
How to test functionality that uses a database
Overview When I first started learning how to use a database, I wrote code that was hard to work with. To test that functionality worked correctly, I did a lot of local set up that required manual actions like creating tables, adding entries, deleting entries, etc. Sometimes I would deploy my code to see if…