Fullstack Academy First Impressions

Week 1 Day 2

Thoughts on what we are learning

I am really glad that I started the cs50x course before starting at FS. The first two days
were studying data structures and I made sure to watch the cs50 data structure videos as part of my pre-reading. This really helped me to understand the theory behind the data structures and abstract data types as well as why they are important for speed and memory management in general.

On the other hand, the implementation of data structures in Javascript is a little frustrating since we are simulating the structures. I don’t think I would understand why these data structures are relevant without having learned about pointers in C, but without needing pointers, the implementation seems overly contrived. Sure, having to remember to malloc the space for every node in a list and free the memory when you get rid of it is extra steps, but at least you know exactly where it is and what it does.

It also doesn’t help that I find the imprecision of Javascript to be inconvenient at best, and extremely frustrating at worst, depending on the situation. For example, when I first created a simple calculator web app in Javascript, formatting the output to a specific number of decimal places feels like doing a backflip through a flaming hoop. But Javascript isn’t necessarily the best choice for complex computation or implementing low level data structures, so I’m hoping that when we get to the places where Javscript is the best choice, I learn to love it for its strengths instead of loathing it for its weaknesses. I firmly believe in using the right tool for the job. While an axe can be used as a hammer, an axe, a knife, or a plane, it might not be the most efficient way to turn a tree into a 1/4 inch thick board.

Thoughts on pair programming

I think pair programming is a good way to work through a problem. It’s harder to just try things without understanding how they work because your partner will also need to understand what is happening.

When working remotely and pair programming, the biggest weakness is the time to switch places. Instead of just switching seats, you need to leave the test specs, commit the changes, and push them. Then, your partner still needs to pull the changes, open the file, deal with the conflicts , share their screen, and restart testem. This makes switching quite a process when you are in the middle of a good flow and have limited time to solve the workshops.

My biggest weakness in pair programming is that I feel like I am always taking over, whether I am the driver or the navigator. I will need to figure out how to let the navigator catch up before I start typing. This should be easier after spending years teaching students how to literally navigate, but with students, I know the answer and I am just waiting for them to reach the same conclusion so it is easy to wait. With pair programming, because I want to learn as much as possible, I have a tendency to explain to the navigator what I am thinking/coding rather than waiting for them to come up with the answer so that it is faster and we can continue to move forward.

Some Javascript takeaways

When you want to capture a reference to an object, understand what you are referencing.

1
2
3
4
5
6
7
var obj1 = {value: "first", previous: null, next: obj2};
var obj2 = {value: "second, previous: obj1, next: obj3};
var obj3 = {value: "third", previous: obj2, next: null};
var x = obj3.previous.value
console.log(x) //"second"
obj3.previous = obj1;
console.log(x) //"second"

In the previous example, when we assign x, it is assigned obj2.value, not referencing obj3.previous, so when obj3.previous is changed to obj1, the value of x doesn’t change. Objects are only passed by reference when you are referencing the entire object, not an element of that object.