Wednesday, March 11, 2015

Changes 3/11/15 - IRC Headaches and Refactoring

Today, I spent about 20 minutes trying to find an IRC client for windows.  First I tried mIRC, which is a 30 day free trial, and on top of that has a terrible interface.  I uninstalled that pile of crap, and installed HexChat instead, which has a more understandable interface, but still wasn't that great.  Finn had to help me, because I wasn't sure where to put the channel name (turns out you can't just do irc.mozilla.org#openwebapps)

I also added <!DOCTYPE html> to the beginning of all the app's html files, just in case that was causing issues (I don't think it was though).

I also started to work on the way our app saves the audio position.  Currently, we have hours, minutes, and seconds saving to the HTML5 local storage, which I think is a bad idea for a couple of reasons.  First of all, it's creating persistent global variables for a bunch of book related stuff each time a book is clicked on.

The player position is stored in three separate variables: hours, minutes, and seconds, which is unnecessarily complicated; it is storing what should really be one object, as the three values are obviously related to each other. Thirdly, this implementation only allows for the position of one book to be saved at a time, as the value is overwritten for each time a book is loaded, which I think is the most glaring issue. What if a user wants to start a second book before they have finished the first?

I think I'm going to continue refactoring the time storage functionality first, but it's going to be difficult because I didn't write this portion of the code and so I don't feel like I have a good understanding of what it is doing yet. Additionally, since Finn and I are working separately, I don't want to accidentally break something he is working on with my code. I'll definitely create my own branch to work from to minimize this risk, but eventually we will have to merge those branches.

1 comment:

  1. Nice post! A text book example of good design thinking. As I mentioned on Finn's blog, I plan to leverage your blogs next Summer as I work on educational resources for next year (I promise you a glowing entry in the contributors section ;-)

    By writing so well on the topic of refactoring, you are making my job much easier. Thanks!

    ReplyDelete