• Home
  • Interactive Resume
  • Blog
    • Coding
    • Health & Fitness
    • Success & Lifestyle
  • Contact
  • About

BAOSS

  • Home
  • Interactive Resume
  • Blog
    • Coding
    • Health & Fitness
    • Success & Lifestyle
  • Contact
  • About

Week 5 Day 4 – Callbacks Are Hard.

Home Coding Week 5 Day 4 – Callbacks Are Hard.
Week 5 Day 4 – Callbacks Are Hard.

Week 5 Day 4 – Callbacks Are Hard.

Feb 24, 2017 | Posted by Bao Le | Coding |

Another day of JavaScript, and the syntax is getting easier and easier to grasp. My biggest issue yesterday was just intimately understanding callbacks. Everyone keeps telling me that they’re basically equivalent to Ruby’s blocks. I get that, I can totally see it when I’m shown an easy one-liner example. But when it gets into the more complicated, I start to lose sight of this “template” of how I usually see callbacks.

One of the coolest problems though, that’s kind of helping me understand callbacks a little bit more was an absolutely absurd version of bubble sort. Ironically enough, they called the problem absurdBubbleSort. In the problem, instead of having the function sort the pairs of numbers, the user is prompted to analyze whether or not the first number is greater than the second number within the terminal. If the answer was yes, a true was passed into a callback, which would then continue to perform the swap function within that callback. Once that was completed, a recursive call to the function would happen, thus repeating the cycle until one full cycle returned false to the callback every single check.

My pair and I were stuck on this for a good while. And we were stuck because we weren’t passing the callback in correctly, invoking the recursive recursive call in the right spot, or closing the user input event at the right time. All these issues lead to a very complicated problem, but once we figured it out, it was smooth sailing.

After the bubble sort, we dove right into Towers of Hanoi with maybe… 20 minutes left? We only managed to finish like 3 functions before time was up. It was fun though! Like I said yesterday, it’s really awesome to take old concepts and problems, and solve them with our new language. Today’s topic is on arguments and prototypical inheritance, finishing it off with building an Asteroid game. I’m really hoping that we get to the asteroid game.

Until tomorrow, take care guys!

0
Share

About Bao Le

Web Developer at Dropbox. Reach out, I'd love to connect!

Latest Posts

From Bootcamp to Dropbox: Part 2 – Success in the Program

From Bootcamp to Dropbox: Part 2 – Success in the Program

November 27, 2017

Before reading Part 2, make sure you’ve read Part 1!...

From Bootcamp to Dropbox: Part 1 – Application Process

From Bootcamp to Dropbox: Part 1 – Application Process

October 9, 2017

The Decision The decision to go into programming, without...

Signed with Dropbox!

Signed with Dropbox!

September 8, 2017

After a grueling 3 months or so, my job search has come to...

How I Overcome Rejection and Stay Motivated

How I Overcome Rejection and Stay Motivated

July 17, 2017

Having just had my first real rejection from a company I...

How I Overcome Imposter Syndrome Every Single Day

How I Overcome Imposter Syndrome Every Single Day

May 22, 2017

Before I really go into how I personally overcome imposter...

Future Googler

Future Googler

May 2, 2017

I’m finally “finished” with my interactive...

Introducing the Graduate Job Seeker Program

Introducing the Graduate Job Seeker Program

April 26, 2017

I almost forgot to blog today haha. Please expect not as...

Progress on Progress

Progress on Progress

April 25, 2017

The end of Week X Day X titles are here! And with it marks...

Week 13 Day 5 – Google Co-Working Meetup

Week 13 Day 5 – Google Co-Working Meetup

April 24, 2017

The Google meetup was absolutely dope. It was an incredible...

Week 13 Day 4 – Catching Up

Week 13 Day 4 – Catching Up

April 21, 2017

I think I have a pretty solid game plan of how to attack my...

Contact Us

We're currently offline. Send us an email and we'll get back to you, asap.

Send Message

Let’s Connect!

© 2025 · imbaoss.com

  • Facebook
  • Twitter
  • Instagram
  • LinkedIn
  • GitHub
Prev Next