Understanding References to Ojects, thenewboston 5
- in node, everything is a reference
- getting a reference when you adjust variable
- equal signs
- two
- number can equal to string
- compare value
- three
- number is not equal to string
- compare values & types
- string =/= integer
- this
- "the thing that called it"
- global
- the whole program will call it
We found this video somewhat confusing because the explanation was somewhat repetitive. He went through the topic quickly and we think that we will need to dig deeper into this idea. We have a sense of what it is, but we are not that confident about it.
Prototype, thenewboston 7
- allows you to give new method and properties to things
- can set equal to a function
- += means add
- -= means subtract
- every thing has access to the prototype
- can set amount to properties
So far, this was our favorite video because it was entertaining and educational. We got a lot of information out of this; it was explained in a way we could both understand. The process to do this seems long, but it is just a lot of repetition.
Modules, thenewboston 8
- group similar codes together
- organizes
- to include modules in the main file
- export and import to original
- module.export
- tag on any variable
- only this variable's content will be exported
- other variables stay
- to import module
- var name = require ('./movie')
- requiring a file to be placed into the main
- look for movie in the directory
- never include .js when doing this
I think that this might be the most relevant to us right now and it seems very useful. We thought that maybe we could use modules to separate certain characteristics in a drone such as the pitch, yaw, and roll movements. These would all be characterized in movements which is one small part of the actual drone.
More on Modules, thenewboston 9
- module.exports = {insert the code}
- quicker and more efficient way to export modules
Quick video that taught us about about a more efficient way to export modules instead of the method in Modules, thenewboston 8. We could import multiple codes at once with this method without having to "tag on" variables one by one to import them. In this method, anything inside the bracket are objects that will be imported to the main file.
Shared State of Module, thenewboston 10
- default behavior is to share with other files that are imported
- makes it so one variable will be referenced
- can be useful for performance and memory
- it can be inconvenient for specific person's preferences
We understood what the video told us when it said that this could be both convenient or inconvenient when this is applied. Since one variable will be referenced and shared when it is imported using this method, the other variables will have the same state essentially. This could be easier when there is a scenario where repetition is necessary; it would make our lives a lot easier because everything will be done for you. However, this can be inconvenient if every variable was unique and did not share this common trait.
This week, we wanted to familiarize ourselves with coding. We watched tutorials from thenewboston to enhance our understanding of node.js because we will be using it. This YouTube channel was made node.js easier to comprehend and it was entertaining. We learned about referencing, modules, prototype, and the meaning of "this." There was a lot of information to soak in and we wanted to understand it, so we took our times and re-watched the videos to see if we absorbed most of the content. We spent most of the time this week looking at our previous assignments to recall any information that would be necessary to understand. After this assignment, we were coming up with ways we could apply this knowledge to our project.
Due to vacation and work, we do not think that we can use the test out the drone at the moment.
No comments:
Post a Comment