echo “Speak My Language”;

Feb 1….the goal for February is to learn how to code.  I landed on this goal for a number of reasons:  1.  my husband can code and is one of the smartest people I know, so I thought this may give me a little peek into his world.  2.  Even though I’m not in a technical role, I do work in IT and thought it may help with my ability to toss around IT slang and sound somewhat like I know what I’m talking about.  3.  Girls who code…I mean…awesome.  The prep work for this goal started a few days ago while I was wrapping up my January goal (waking up at 4:45am) just through general conversation with Chris.  He asked me what language I wanted to learn, my response “uh….no one has really given me a menu of options…so…I don’t know? what language do you know?” didn’t really give him much confidence in me.  He then asked me what I wanted to get out of this and my response was “uh…again…menu of options…I mean…what can this get me?”  So, I decided day 1 would be spent figuring out what languages existed and which one I should learn.  Apparently saying “coding” and “programming” are the same thing, so as for the English language, I’ll be using the terms interchangeably.  What I knew prior to today was, Chris knows PHP but plans to learn .NET soon.  I also learned, from a quick scan of a book I found at microcenter a few weeks ago that Facebook was created with PHP.  Jackpot.  If it’s good enough for Mark Zuckerberg (and Chris Hocker) then it’s good enough for me.  My plan is to spend a minimum of 30 minutes a day learning, whether it’s through researching/reading things that make me feel smart, or through actual coding practice.  I thought I’d bug Chris 1 or 2 times a week to sit down and teach me to actually code, but fortunately a friend of his told me about codecademy (which I called codeAcademy for 3 days before I realized there’s no “A” in the name).  Codecademy is a free online site that teaches you to code.  Even better, you earn badges as you complete lessons.  Only takes a little virtual “congrats” to keep me going.  There’s a video on the homepage (http://www.codecademy.com/) that’s only 51 seconds long with a guy who says some of the best websites of 2013 were created by codecademy members so I figured this was the best way to go.  You can learn languages like PHP, Javascript, jQuery, Ruby, Python, etc.  So, right in the middle of the Super Bowl I decided I would sign up and get started.  It took about 3-5 minutes of my dedicated 30 minutes to get a login.  Not because it asks a lot of questions….matter of fact….it doesn’t ask you any questions except your email and a username and password.  I was off to a horrible start when I kept typing “Brooke” into the email field.  Chris unfortunately was watching over my shoulder and kept telling me to type my email address in, but I swear it asked for my name.  I proved my point by typing in “Brooke” 3 more times before I finally deleted it and realized it said “email” in light gray underneath my name.  Yeah, I’m going to be amazing at this coding thing.  I did manage to get a login created and it instantly popped up a little black box with code already populated.  It was the first time in history that code was on my laptop and not Chris’.  Let’s get this party started!  Chris was instructing me through the first screen using words I’ve never heard before while I clumsily typed in what he said while trying to remember the words he was using.  He said PHP is on the server side and Java (or was it Javascript?) is on the client side.  He kept pointing at himself when he said “client side” so I just imagined java, as in a cup of coffee, in his hands and decided that’s how I’d remember that PHP is on the opposite side of the imaginary coffee.  Apparently the first phrase people type when they learn to code is “hello world” which Chris helped me to do….an initiation of sorts.  I’m officially “in.”  He left me to learn on my own where I navigated through a series of screens for about 20-30 minutes which showed me all of the stuff he was talking about.  I learned things like how PHP ends every sentence (“sentence” isn’t the right word but I’m afraid to say “string” because I can’t remember if that’s the right word) with a semicolon.  I also learned that you have to start your string (okay, I’m just saying “string” because I don’t know what other word to use) with a <?php and then end it with ?>.  You also have to type in the word “echo” (minus the quotes) if you want it to show the phrase you’re typing.  Codecademy has the black box with the code you’re working on visible on the left, and a white box on the right with your output.  I managed to learn how to type my name, I successfully used the concatenate function and inserted spaces between my first name, last name, and second last name (that one took a couple tries…that 2 last names thing apparently causes problems not just when checking into hotels and the doctors office, but with this too), and I multiplied a couple numbers.  Oh yeah, and I earned my first badge.

What code looks like…

Firstline

The output of the code above…

PHP

My reward…

Badge1

Feb 2….I couldn’t wait to get home from work and log onto codecademy to learn a few new things.  I did, and I even earned a few new badges (for a total of 5) for completing the conditionals and control flow section.  That’s where I learned how how to do if / else statements.  In English, I basically told it to say ‘if something is greater than 6, then make it say “you get a 10% discount.”‘ A few minutes later…on the right hand side of my screen…it said “you get a 10% discount.” Yes!  The nice thing about codecademy is that it will give you the instructions and then gives you the option to hit the hint button if you want to see an example of what you should be typing.  I guess I was in denial about how much I was relying on the hint button because stupid codecademy asked me to complete a series (or whatever the heck the word is) without a hint button.  I kept typing in formulas similar to excel, none of which had I learned or practiced in codecademy, and it kept giving me an error.  I started caving under pressure and just started adding quotes and semicolons anywhere I could fit them in.  And why does it sometimes have you hit enter and skip down to the next line before you close out the string with a little squiggly bracket like this:  }  and other times it’s on the same line?  I tested it and it works both ways, with or without hitting enter.  I also noticed that in one example it said “print” where it had me using “echo” before.  It was like taking those standardized tests in high school where you swear you were smart all year and then you fail one of your senior proficiencies and have to go to high school an extra week before graduation when all of your friends are done….not that I would know.  If tomorrow == today { echo “not fun”; }