My First “Program” Attempt

I finished Codecademy’s JavaScript track a couple of weeks ago, but haven’t yet had the chance to make a post, so here it goes. I’ve been busy and haven’t really done much programming since (aside from a little more dabbling with some additional JavaScript lessons on Codecademy’s site that aren’t part of the track). Since I was falling a bit off the programming wagon, I asked my husband what I should do next. He challenged me to make a dog management program in which I could program in dogs, add dogs, remove dogs, and search for dogs. Hmmm…well, seemed simple enough, but it had been a couple of weeks since I had really been doing much programming, so I was a bit nervous. However, never one to pass on a challenge, I figured I’d give it a go. Plus, I’m pretty sure Codecademy had prepared me enough for a simple program like this, so the next day I attempted my program.

Codecademy has a section where you can use their website to write programs (they have one for Python, Ruby, and JavaScript). I selected JavaScript and started programming away. It was pretty smooth sailing for the most part. I first created a Dog object, which included the properties name, breed, and age), so that I could easily create some sample dogs for my program. After making the object, I created a spikey variable and an echo variable (my two dog entries). I then created a var contacts array which included spikey and echo (obviously…). Since I wanted to be able to print out the names of my dogs, I then added a printDog function that would print to the console the dogs’ names. Next, I created a list function, so that I could quickly print out a list of my “dog contacts.”

Because my husband wanted me to be able to search for dogs, I then added a search function so that I could easily see if a particular dog was in my contacts. The next part of the program was adding an add function so that I could add dogs and then finishing off with a remove function so I could delete animals from my contacts (what can I say? Spikey and I have a tumultuous relationship… ūüėČ Just kidding.). ¬†The hardest part of the whole program was simply figuring out how to remove a contact, since Codecademy hadn’t gone over this in the tracks. ¬†Because I wasn’t entirely sure how to do this, I did what everyone does – I googled it. Once I had googled it, I quickly realized that I would have to use array.splice, which ended up being simple enough.

Now came the real test: seeing if I had passed the challenge presented to me by my husband. Sure, I¬†thought¬†I had completed the challenge correctly, but would the program¬†actually¬†work? ¬†Well, I decided to either sink or swim and called the hubby over to test it out. Sure enough, it worked! ūüôā Yay. Rock on for a beginning programmer. In retrospect, I know this is a truly¬†simple program, but having never programmed before in my life and only completing 2 weeks of recreational programming (about 1/2 an hour to an hour a day), I felt very proud of myself. ¬†So even though you may feel like banging your head against the wall, don’t…just keep on programming little grasshopper.

You can find my code below. Simple, I know, but good enough for me. ūüôā Now my husband wants me to make modifications to make it more complex….gulp.

Happy Programming!


function Dog(name, breed, age) { = name; 
    this.breed = breed; 
    this.age = age; 

var spikey = new Dog("Spikey", "chihuahua", 7);
var echo = new Dog("Echo", "chihuahua", 2);
var contacts = [spikey, echo];

function printDog(dog) { 
    console.log( + " "); 

function list() { 
var contactsLength = contacts.length; 
    for (var i = 0; i < contactsLength; i++) { 

var search = function(name) {
    var contactsLength = contacts.length;
    for (var i = 0; i < contactsLength; i++) {
        if(name === contacts[i].name) {

 function add (name, breed, age) {
     contacts[contacts.length] = {
         name: name,
         breed: breed,
         age: age

function remove (name) {
    for (var i =0; i < contacts.length; i++)
   if (contacts[i].name === name) {
      console.log("Is this working?");



My Continued Exploration of JavaScript with Codecademy

Okay…I’m not even sure if I should be writing a blog post about JavaScript right now, but figured it’s been a while and my brain is completely fried from learning to code, so now’s a good a time as any.

When I first started Codecademy I was using Google Chrome, but periodically while I was coding, Chrome would suddenly crash and I’d lose all the progress I had made on a particular exercise and would have to start over. ¬†This brought me back to my high school information technology class (grade 9 perhaps?) where I had visions of throwing my large, old, stone-age desktop across the room for its continuous freezing and crashing capabilities. ¬†I can still remember what we were working on – typing up a good, ole letter to a fictitious company (yes, terribly exciting, I know). Technology was not my friend. Needless to say, a few crashes later, I decided to use Firefox instead which has since decreased any additional levels of anxiety and frustration (and the possibilities of my lovely old laptop going crashing across the room…I kid in jest of course).

Back to JavaScript…as I mentioned in my original post, I was using Codecademy to learn about it and was progressing through the 8 major sections that comprised the JavaScript track. ¬†I’ve been pummeling away at the courses and exercises and have now completed the 6 first major sections, which leaves 2 remaining. I’ve learned about the basics (i.e. strings, names, numbers, etc.), functions, for loops, while loops, control flow, and data structures. I’m currently working away at Objects I and am beginning to feel like a sinking ship. ¬†All the concepts and information are bubbling away in my brain, but they are also getting intermingled and a bit jumbled up (kind of like a jigsaw puzzle that fell onto the floor after you completed 3/4s of it). I imagine any of you who started learning to program with very little information technology background can relate. ¬†There are definitely times where I feel frustrated and want to just quit, but then there is the other part of me that seriously CANNOT wait until I am competent enough to actually start programming independently. ¬†I have visions of iPhone apps dancing in my head. ūüėČ Although I find programming to be frustrating and confusing at times, I am enjoying the challenge and the balancing act that it entails. ¬†I love it and hate it at the same time.

Codecademy itself has been a pretty good learning tool in my journey of programming awesomeness. ¬†Sometimes the courses overlap each other or leave out certain concepts that you’d think they should have mentioned or at least provided in the “hint” section. Different course instructors definitely have better capabilities of getting their information across to the “student” and you soon begin to look forward to certain instructor’s courses more so than others. ¬†I’m not necessarily saying that any of the instructors are poor; in fact, in general, they all seem to be very competent and effective in their instructions. ¬†But, as with anything, some seem to be more eloquent in their instructions than others. ¬†This should come as no surprise, though, as it is always the case regardless of the profession or situation.

Basically, what I guess I’m trying to say is that this journey is not going to be easy. ¬†If you, too, are learning to program you can probably relate and I just want you to know that, dude, you’re so not alone. ¬†I feel frustrated, excited, annoyed, and compelled all at the same time. We’re like kids learning how to ride bikes. ¬†We’re going to fall down, get scrapes, cry, have hissy fits and then get back onto the bike and try over. ¬†Before we know it, we’ll be riding without hands and plunging down mountains on crazy terrain. ¬†I’m in for the long haul and I hope you’ll continue to join me on my escapades.

Now that my brain is a jumble, I think it’s time to throw in some Focus T25 and work out that frustration. There’s something about exercise that just makes me feel so much better and zaps my worries away.

A Deeper Plunge Into JavaScript with Codecademy: The Beauty of the Switch

As I mentioned in a previous post, I have been exploring the world of programming starting with JavaScript via Codecademy. ¬†Today is my fifth day of learning and it seems to be pretty smooth sailing (albeit with some definite hiccups!). ¬†I haven’t been spending a huge amount of time each day, approximately around 1 hour per daily session. Thus far, I have explored the very basics (i.e. prompts, strings, numbers, console.log, etc.), functions, ‘for’ loops, ‘while’ loops, and if/else statements, to name a few.

As I was programming, I began to run into some forgetful moments. ¬†Yes, the hints on Codecademy are excellent and Google is a beaut, but I was starting to get a bit annoyed. ¬†There were times where I felt that the exercise I was being asked to do kind of skipped over some instructions (alternatively, this may simply have been because I had forgotten a previous task or simply wasn’t paying attention with the instructions or tips provided for the exercise). ¬†One particular annoyance occurred during my exploration into “while” loops. I went from the very simple programming of very basic while loops, to having to suddenly write a while loop that logs “I’m looping!” to the console three times without using console.log calls. ¬†Sure, for you programmer masterminds out there, a very simple task. For me, a pathetic beginner who feels a great achievement writing a VERY easy while loop, this was a very daunting task. ¬†The exercise had some of the loop previously written, but I became quite confused with empty brackets. I couldn’t recollect this being mentioned before, so I was at a bit of a standstill. ¬†I checked the Hint, but was still confused. I ended up calling upon my husband for some back up (and yes, he did look at me as if he was trying to instruct a small child…). ¬†Needless to say, I figured out how to do the task. ¬†Afterwards, I decided that perhaps part of my difficulty was that I kept forgetting what I had learned previously. I then decided to quickly go back and review the courses (which I LOVE about Codecademy). As I reviewed the previous courses and exercises, I began to jot down little reminder notes. ¬†Doing the process a second time and now having notes to refer back to is immensely useful. As I have proceeded into more lessons, I can now quickly look up a note I did and be able to complete the activity more easily.

Enough of my complaining, however! ¬†There was one thing that I did today that I absolutely loved (and I’m not entirely sure why…): the switch statement! ¬†The switch statement basically allows you to design a specific number of options (called case(s)), and then check a variable or expression against them to see if there is a match. ¬†If it matches, the program performs a specific action that you have specified. ¬†If it doesn’t match, then you execute a default option specified by you. We had a series of exercises introducing and reinforcing the switch statement. ¬†It was probably the easiest and quickest thing I have picked up on thus far (aside from the basics, like console.log and prompts). ¬†Codecademy broke the switch statement into chunks, having you first complete a small part, then adding on until you have to make your own, which for whatever reason, I found immensely entertaining. ¬†So…I guess what I’m saying is if you are finding yourself frustrated with the if/else or for loops or while loops while learning JavaScript, take a breather and look up the switch statement. Play around and have fun with it. ¬†Make yourself giggle. ¬†I sure did… ūüėČ

Below is a … um … G version of a switch I wrote. He he.



Happy programming!