teh hayley

the importance of quick wins

Yesterday, I was attempting to go for some quick wins. After finishing yesterday's blog post, I immediately went to work on trying to get my consolidated IMDB scraper off the ground.

I bought the domain (deciding on a name sadly, is often the hardest step), and then promptly stalled.

I had basically built a mini site generator, but I had no idea how I'd wedge that design into the mini sites being part of a consolidated site (without just using subdomains of course). I was trying to draw up tweaked scripts. The first problem being that I was trying to keep things unified so that I could use one script to update all of the sites. I got nowhere with that. So then I started to try to just spin things off into a new script, but part of the problem is that I used thor and I wrote these scripts like a year ago. I was running into errors that I just didn't understand and at that point I was so burnt out from all of the wheel spinning that I basically had to give up.

No quick win.

I left with the idea that when I came back to it I would just basically do an independent site. Oh, sure I'll be copy/pasting a lot of the template code and such, but I think it's ultimately going to be quicker and less messy to have the two separate code bases. And besides, if the consolidated site takes off, I likely won't be wanting to do new separate domain projects anyway, since that's a minimum cost of $10/year.

So that's where that project is.

So todo item #1.

complete the MVP of the consolidated IMDB scraper site

I did do other programming yesterday, but given all of the problems I had had with the above project, I figured it would be better to pick something fresh.

So I worked on the angular-based BMI calculator and I actually got decently far with it.

So far, you can enter your weight in pounds and your height in inches and it immediately returns your BMI number as well as the named range you fall in (like Obese Class II or something).

The thing that's got me conceptually stuck now is how best to implement the ranges. This would be one of these cases where my desire to DRY ends up taking me longer to solve the problem than if I'd just littered my code with a bunch of redundant work.

Here are some examples ranges:

In total, there are 8. If I want to get even fancier, I'll eventually add support for the US, Japan, and Singapore versions, which is actually something I'd like to do. Which of course, is yet another reason that I'd like to do this right the first time.

So I think what I'm trying to do is have a hash of the ranges and their category names (and technically, I think in JS, it's just an object and not a hash).

$scope.bmiRangesHash = {40: "Obese Class III", 35: "Obese Class II", 30:"Obese Class I", 25:"Overweight", 18.5:"Normal", 16:"Underweight", 15:"Severely Underweight", 0:"Very Severely Underweight"}
      

Frankly, I don't know if I'm on the right track, but the problem here is that the "keys" are returned out of order (again, probably not called a key, since it's not technically a hash object).

bmiRangesHash = {40: "Obese Class III", 35: "Obese Class II", 30:"Obese Class I",
      25:"Overweight", 18.5:"Normal", 16:"Underweight", 15:"Severely
      Underweight", 0:"Very Severely Underweight"}
      
      for key, value of bmiRangesHash
        console.log key
      

Which returns:

0
      15
      16
      25
      30
      35
      40
      18.5
      

So I can't effectively infer the actual range of anything because it will skip the 18.5.

I had some ideas about how I would go about solving it, but I wanted to use something like underscore or Sugar to get some shorter methods and then I was kinda stuck for how I'd easily add those to the page without having to freaking set up a shell of a web page just to do it (I figure this is probably a good use case for jsfiddle).

And that's where I left that problem.

figure out a DRY way to handle the ranges on the BMI calculator

So next would be Hack Spanish.

As mentioned again and again and again, fill-in-the-blank quizzes were always the intention for the site, but the out-of-the-box quiz solution I found only handled multiple choice... and my JS skills weren't up to snuff at the time, to build my own thing.

But the more I work with Angular, the more I start to get an idea of how I'd actually handle things.

I've even got this idea for how I could do hints on the answers. Like, if you're doing verb conjugations and you get stuck on one, rather than just being shown the answer, it could give you a few characters to see if that helps you remember.

And from the beginning, I've wanted to try implementing something where, for the questions you got wrong, it would

I didn't know how well this would work in practice, but I thought it would be really interesting to try, and as far as I know, I haven't seen anyone implement this (not that having seen someone else implement it would stop me from adding it to my own site).

So finally:

implement a fill-in-the-blank spanish quiz on Hack Spanish

I would love to get all 3 of these things done (and more) and there's where I circle back to the importance of quick wins.

Days like yesterday where you get stuck in the mud are real productivity killers. So I'm thinking, from here on out, I should go after whichever thing looks like the quickest win, to tackle first in the day.

Unfortunately, yesterday, I probably would've thought that the cast site, was the quickest thing.

Today, I'm gonna guess that figuring out the BMI calculator data structure is the winner.

I'm probably wrong.


teh hayley