Getting Started in jQuery and the DOM

Last week, I started learning about jQuery and the DOM (Document Object Model). At first, I was really excited. Finally, I could dress up my JavaScript and bring it out in public! But within minutes of delving into the documentation, my eyes glazed over and I became filled with the feeling of hopelessness and dread that has become familiar in my code self-teaching experience. At that point, I closed my laptop and went to bed.

The next morning, though, I sat down at my computer with a new game plan. I’ve found that seeing examples of code (instead of reading about it in generalized terms) is usually the easiest way for me to make sense of new concepts. So–I actually don’t know why it took me so long to think of this–I went to YouTube.

This video (the first in a two-part series) from the DevTips channel was probably best out of all that I watched. It’s professionally made and has a really clever example of showing how an event listener (mouse movement) can be used to create this psychedelic color-changing window.

This DOM manipulation video is less flashy, but demonstrates some basic and very useful techniques. And this video, which is the start of a three part series, got me started in jQuery with some clear and straightforward examples.

For a few triumphant moments, I congratulated myself on conquering this one (admittedly relatively small) beast–I know what jQuery and the DOM are and the very basics of how to use them! Now, back to work…

 

 

Using Terminal and GitHub

I’ve dipped a toe in the world of GitHub and Terminal over the past few weeks. I’m still getting a grasp of how to use them, but here are the basics I’ve figured out so far.

A computer terminal is used to enter data. The Terminal app on my Mac opens to a shell (on Mac known as Bash) where I can type command lines. According to this handy MacWorld article, “a command has three elements to it; the command itself, which calls a specific tool, an option which modifies the command’s output, and an argument, which calls the resource on which the command will operate.”

I can manipulate where the command is executed by changing or adding directories. (“cd /Users/rachel/homework” changes directory to this preexisting directory, for example. I can see which directory I’m in by entering “pwd.”)

Changes made in Terminal to a forked project from GitHub can be uploaded back into GitHub (after doing Git add and Git commit in terminal), and a pull request can be submitted. A pull request notifies others working on the project of my changes, so they can review and choose to add.

Codewars vs Coderbyte

For the past two weeks, I have been solving as many practice problems as I can manage in my spare time leading up to coding bootcamp admissions exams. The two sites I’ve mainly been using are Codewars and Coderbyte.

Codewars is a community-driven site that uses some gimmicky terms (“kata” are code challenges completed to achieve “rank”) to make the challenges feel like a special mission, I guess. The two downsides I found with Codewars were that I had trouble getting around at first (the interface is a little busy) and I had some glitches when I tried to submit my answers. The upside is that the challenges are sorted into eight different levels, so you don’t have to work on problems above or below your ability level.

Coderbyte challenges have a straightforward setup with easy, medium, and hard level problems. I have been working on the easy challenges, but have found a big range in difficulty. Some I could solve with only my knowledge from finishing the JavaScript track on Codecademy and a little Googling. Others were way beyond my ability level and I had to look at the provided solution. A very limited number of Coderbyte challenges are free. I invested in the $24 a month for access to more questions and the solutions (though sometimes users had better solutions than the site provided.) The membership fee also gives access to bootcamp study guides, which I found very helpful.

Overall, I’ve mainly stuck with Coderbyte for its reliability and simplicity, but turned to Codewars for a change of pace, when needed.

JavaScript Cheat Sheet

Finished Codecademy’s JavaScript course recently, as I’m preparing for bootcamp admissions tests. The similarities between JavaScript and Python (which I used in a Udacity course) were obvious from the start, and of course, the programming fundamentals (for loops! while loops! if/else statements! etc) are the same.

This week I’ve started doing Coderbyte problems, which is certainly putting my new knowledge to the test. I like Coderbyte’s user experience–very clean and straightforward. (Tried Codewars last week and didn’t like the setup quite as much.)

The cheat sheet I created of Javascript basics has come in helpful, especially for double checking my syntax. Here’s a PDF of what I have so far.   JavaScript Cheat Sheet

(p.s. these are my personal notes, not any sort of official guide to JavaScript.)

While Loops vs. For Loops

I’m still half forgetting the difference between while loops and for loops most of the time (and when to use each one), while working in both my Codecademy JavaScript course and my Udacity Introduction to Computer Programming course. Since I’m starting the while loops section on Codecademy now, might as well hammer out the difference once and for all, so I don’t have to keep leafing through my notes.

According to Codecademy introduction to while loops: “‘While’ loops are like ‘for’ loops, only they don’t need a counter—they continue to run until their condition is met.”

Mathbits.com (forgiving its goofy notebook-in-space motif) also offers a clear differentiation:

  • while loops must repeat until a certain condition is met
  • for loops are repeated for a specific number of times

With these in mind, here’s a reminder example I’ve made myself to make the purpose of each stick in my head:

  • Ke$hify For Loop: For length of ‘Kesha’, replace ‘s’ with $
  • Gaga While Loop: While naming songs, if “Gaga” is artist, add song to playlist

Breaking Down Complex Problems

Working on Udacity lesson 2.5 “How to Solve Problems” this week, which encourages taking a systematic approach to solving complex problems. The sample problem discussed throughout the lesson is to return the number of days old someone is, using their birthday and today’s date (or any other date, actually.) My first attempt mainly included frustrated stabbing in the dark with solutions that quickly became overcomplicated when I realized I needed to take in leap years, etc.

The Udacity lesson walks through some basic guidelines, which seem obvious in retrospect. Basically, it provides an organized approach to solving a problem, starting with determining inputs and outputs, working out some examples without code, and then deciding on the simplest system.

The instructor emphasizes breaking down the solution into manageable parts and testing each step to determine each part is functional and works as intended before continuing.

Seem like good practices to refer back to as the problems continue to get more complex.

Podcast: Developer Tea

This morning I listened to Developer Tea, which describes itself as “a podcast for web and software developers hosted by a developer that you can listen to in less than 10 minutes.” Though it didn’t live up to its under ten minutes promise (the host, Jonathan Cutrell, seems to have gravitated towards longer episodes over time,) it’s the best programming podcast I’ve found so far.

Cutrell was a great host–well-versed in the topic and a solid interviewer–and his guest from the episode I listened to, Simon St. Laurent, was equally knowledgeable. Some of the topics covered were beyond my comfort zone, but Cutrell does acknowledge topics that are outside of beginner-level understanding and includes extensive links for further research on the show’s website.

One additional note from the show I’m going to check back into at a later date: Developer Tea is sponsored by Hired.com and Hired will double the signing bonus for users who find a job through Hired using the Developer Tea link.

Code Newbie and Udacity

I’ve been listening to the Code Newbie podcast to try to get a better sense of what kinds of programming job options exist and how people move into those jobs. The quality of the episodes varies, but I found episode 1 with Carlos Lazo and episode 7 with Ciara Burkett most helpful so far. Ciara Burkett mentions this article on the Hacker School site (now The Recurse Center) called Fundamental Qualities of Good Programmers, which gave me some ideas to think about and may be worth looking back on when I have more familiarity with some of the topics.

I also just created a Udacity account and am looking through their free beginner classes.

Python and Introduction to CS

Today I began the Python exercises on Codecademy. So far the exercises focus on learning the syntax without much context, but I did like the building a tip calculator lesson.

Also watched the first video in the MIT OpenCourseWare Introduction to Computer Science and Programming class. Main points:

  • An algorithm is a description of how to perform a computation.
  • It includes instructions (aka flow of control) and a termination condition.
  • A programing language has instructions and control structures.
  • The languages have structure (syntax) with meaning (static semantics and semantics).