Monday, May 19, 2014

Day 6: basic jQuery, debugging javascript, and traversing the DOM

Boy did that weekend go by quickly. On Saturday I worked a little bit on responsive design just to keep my brain still going with the knowlege. But on Sunday I definitely made sure to get plenty of rest so that I can recharge.

The first week is now behind us and I feel like I have a great understanding of HTML and CSS and these upcoming weeks, I will continue to master it through repetition.

This morning's lecture was on the foundations of jQuery, the popular javascript library that makes it extremely easy for developers to make their web application interactive. I previously made a little game using a lot of jQuery and boy did it really help today.

Although the lecture was meant to cover foundations, Michael Choi also went into pretty advanced topics like callbacks. He wanted to expose us to these more advanced concepts early on so that we'll be able to have a good understanding.


Our first jQuery assignment was to create a webpage that illustrated 18 of the most used jQuery functions. This was honestly quite a tedious tasks. But honestly it really forced me to understand what each function was doing in order to finish the assignment. Coding Dojo wants us to learn these and not every single one in the jQuery documentation, because you'll be using these functions over 99% of the time. If there is ever a time when you need to use a function that's one of these, you can just look it up in the documentation. This is a reasonable list of functions to memorize by heart, which isn't too hard to do granted that they're pretty self-explanatory and we'll be using these functions repeatedly throughout the assignments in this section.


After doing some assignments using jQuery functions, I found an assignment in which we were to clone a repository from github and debug it. Javascript is pretty unforgiving in that if you have a minor typo in your code, all the functions in the code may not work or the page might not even show up at all.

I really had the pay really close attention to the syntax. There were 5 mistakes in the code and the page wasn't going to render properly until you fixed every single one of them. Usually with HTML or CSS, you slowly gain functionality with each bug fix, but with javascript that is just not the case, it's really all or nothing.


The last assignment I could get to today was an assignment where I had to traverse the DOM using jQuery selectors like .parent(), siblings(), and children() and apply the necessary functions on those elements.

I really feel strong about my knowledge and trust in the curriculum. The structure is made so that you get what you put in. I was able to help some of my classmates with some of their problems they were having. The funny thing is that 80% of the problems they were dealing with wasn't due to a lack of jQuery knowledge at all. It was usually problems linking CSS and JS as well as connecting bootstrap and jQuery. I feel like I've seen so many of these little issues that I've grown a keen eye for the little details and clues that point to what the origin of the problem is.

I got about a half a day of jQuery left to do, so I'm going to try and finish that as well as finish the optional responsive web design courses. We're going to be learning SQL and databases in general later this week. The topic that I have absolutely no knowledge of so gotta make sure I can allot lots of focus and energy in learning that topic.

11 comments:

  1. JS Lint is awesome for finding typos in javascript. Saves a bunch of time.

    ReplyDelete
  2. Wow yeah that's an awesome tool. Especially for catching more nitpicky things (like space vs tabs) that aren't as obvious.

    ReplyDelete
  3. I heard it is best practice to link your scripts at the end of your document, that way if there is a bug in your JS your page can still load correctly.

    ReplyDelete
  4. Hey Unknown. Yes it is best practice to link your scripts at the end. The reason is that the HTML should fully load before your JS begins to interact with it. If the JS starts to run before the HTML is fully loaded, you might get a "Element not found" error.

    However if you take a look at my JS code, you will find that I always have a $(document).ready which will wait for the document to fully load before running. Which is essentially the same thing as putting the JS at the end of the file.


    I definitely wouldn't have been able to give you this answer when I first wrote this blog post though haha. Thanks for reading!

    ReplyDelete
  5. What hardware did you and the others use to code on? Thank you for your time?

    ReplyDelete
  6. Hey Jeremy!

    Most of us, including me, were coding on Macs. Only one was on Linux and one on Windows.

    ReplyDelete
  7. Speaking of hardware, are their computers supplied at the dojo? Or do we bring our own?? I'm going to take the Intro to Code Workshop next Saturday and wanted to be prepared. Really stoked to have found this blog!

    ReplyDelete
    Replies
    1. Hello Yatoni,
      I'm scheduled to start in September and I can confirm that you have to bring your own laptop. Happy coding!
      -James

      Delete
  8. Hey Yatoni.

    It's been over 2 years now since I started the bootcamp.

    But I'm quite certain that it is still expected that you bring your own laptop. It's better that way anyways! :D

    ReplyDelete
  9. Hi taeyoung,
    thank you for the sharing. It helped me a lot in figure out how a code camp works. But unfortunately there is no code camp here.
    But I really want to experience this curriculum from CodingDojo.
    Can you share to me the lectures and the assignments of the curriculum.
    Thank you very much.

    ReplyDelete