Morgemil Part 5 – A step backwards and forwards

My brother and I once took a ballroom dancing class where we were taught the basics of the waltz, salsa, tango, and foxtrot. I wasn’t much interested in the salsa and I no longer remember the foxtrot or the tango. What I do remember is a few steps of the waltz, especially the box where the movement of your feet make the corners of the box.

The dance instructor kept me making the box for a while and it was a little boring, we didn’t actually go anywhere. And that is what I feel like I’ve been doing on this project: taking a step backwards for every step I take forward. After I learned how to make the box and practiced it for a while, the instructor then showed me more steps that can be taken with the waltz to allow free-reign of the ballroom. In the same way, I’ve been brushing up on F# and functional paradigms so that I may have all the power they offer.

Continue reading Morgemil Part 5 – A step backwards and forwards

Morgemil Part 4 – Confidence

Being able to say that I have confidence in something I programmed is a great feeling. To build this confidence, I’m using unit testing. Unit testing is a method of verifying that individual pieces of code work as expected. I will not get into all the benefits of unit testing, I’ll just say why I am doing it: to check my work since no one else is doing so.

I began work on unit testing this afternoon. I installed NUnit and the Visual Studio extension to run unit tests directly:Nunit_extensionThen I added a new project to the solution called “Test”Nunit_projectI started with the easy file to test. Vector2i is all integer math, the expected results should be easy to reason about. To test Vector2i I made a new file with the same name and added a suffix “Test” in the new project. I read up on a quickstart with NUnit and F# and I wrote some code:

Continue reading Morgemil Part 4 – Confidence