Project number 7 is short and sweet to help me catch up on my intended schedule to feature one project and update per week. I’ve been falling behind lately as other endeavours have distracted me. And fellas, remember, that just because it’s short that doesn’t mean it lacks utility.

This week, I wrote a lazy image loader script. Why? Because several months ago I created a website for an online community I’ve been a part of forever that would offer quick access to community members’ Twitch.TV streams. As I built the page up, it was suggested I also include streamer highlights. So I did. As the list of streamers grew, so, too, did the list of highlights. Since each highlight featured a small picture, it quickly became less than optimal to simply load every image on each page load. At the time I didn’t know how to make a lazy image loader script so I found one via google and used that.

Oh, hello again. I know this one is late but I like to think it can be excused. Missile Defense (a knock-off / remix of the 1980 Atari classic Missile Command) is about 850 lines of code compared to my first five projects which have averaged about 350 lines of code. I’m also still working 40 hours a week at my non-coding day job and I do need some down time so my brain doesn’t melt. But enough excuses! Let’s do this.

As an amateur developer, there are often concepts that I didn’t consider (due to a lack of awareness) prior to writing code. Sometimes when researching I get lucky and stumble across a better way to do things and sometimes I get lucky in that someone offers constructive advice and suggestions. With this project, commenter Peter pointed out that I should look into best practices regarding namespacing. The latter link provides a good breakdown of what namespacing is and why it’s important. In a nutshell, namespacing matters when you want your code to be easily adoptable because, in practice, it ensures that you run as little risk as possible in creating a function/global variable that will step on the toes of another script using an identically named function or variable.

Over the last week and change I’ve been working on a side project dealing with one of my many non-coding related interests. Said project involved the use of a Google map and some markers to highlight points of interest. Learning all of the ins, outs, and oddities that come with the Google Maps API required to power my project was a bit of a pain in the arse. That spurred me–after the fact, of course–to try to simplify use of the Google Maps API and create an easy to use general purpose map creation tool. So that became my project for week #4. With SimpleGMaps.js, you, as a programmer, can control many of the Google Maps API options without having to actually tinker with the API directly.

This code review will be formatted a little differently than my other code reviews to this point. I feel that if SimpleGMaps.js is going to be of any use to anyone I should explain what it is, why you may be interested in it, and how to use it before I do my usual process walk-through.

Read on to learn more about SimpleGMaps.js (or view my other code reviews here).

My third code review project (1 here, 2 here) deviates from my previous two in that there is no real user interaction beyond scrolling. This one is a bit smaller in terms of scope than the previous two and there’s a good reason for that.

Posts navigation

Quick Updates

3 Aug 2014

As you parents may know, there's just not enough hours in the day to work a full-time job, be a (first time) parent to a newborn, continue an education, sleep, and still find those few necessary moments to mentally relax. It's going to take a while until I learn how to properly balance it all. I will return at some point, however, to further this endeavour and hopefully carve a path into a career I would truly enjoy!

16 Jun 2014

Well, after a difficult pregnancy, challenging delivery, and a touch and go first week in the world, my fiancee and I are parents to a new baby boy: Isaac Matthew, born June 8th at 1:36pm in the afternoon here in New Brunswick. He's a pretty cool little dude for someone who only eats, cries, and poops, but I like him all the same. During the last little while this blog has been on hiatus and I don't see that changing in the near future.

23 Apr 2014

Another week of inactivity. Me and the missus went home for the long weekend to have her baby shower and see some family and friends that we (I) haven't seen since we moved here almost a year ago. Going to try to get back on track soon!

10 Apr 2014

No project or post this week. I had no inspiration or motivation. I'll try to drum some up and see if I can think of something interesting to explore. Maybe XMLHttpRequests? Who knows!?

19 Mar 2014

I'm a little behind on post #6 because project #6 is a little larger in scope and is yet to be completed. This may end up happening more frequently as my projects become more detailed but I'll try to add supplementary articles which are smaller in scope and don't necessarily have a project attached to them. On the bright side, when project #6 is done, you readers will have another game to play! :>