Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sockets - Kelly #27

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Sockets - Kelly #27

wants to merge 4 commits into from

Conversation

kdow
Copy link

@kdow kdow commented Jun 14, 2019

Litter Patrol

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How are events / event handlers and this.state connected? this.state can be updated through events.
What are two ways to do "dynamic styling" with React? When should they be used? Using external stylesheets and applying className to the elements to be styled is the preferred way. Inline styling is another way to do dynamic styling which should be avoided.
Much like Rails works with the HTTP request->response cycle, React works with the browser's input->output cycle. Describe React's cycle from receiving user input to outputting different page content. React will rerender any thing that has its state changed to the virtual DOM. If this differs from the actual DOM, React will update it.
Compare how React and Rails' views differ. Given different circumstances, these systems have different goals. How does this impact on their design and how we are supposed to use them? React is for views, whereas Rails also comprises models and controllers.
What was a challenge you were able to overcome on this assignment? Updating state effectively.

CS Fundamentals Questions

Question Answer
Consider the code on the first few lines of App.render (it starts with this.state.items.map). What is the Big-O time complexity of this code, where n is the number of active game items? O(n)
What part of React might benefit most from the use of specific data structure and algorithms? state
Consider what happens when React processes a state change from setState -- it must re-render all of the components that now have different content because of that change.
What kind of data structure are the components in, and what sort of algorithms would be appropriate for React's code to "traverse" those components?
Speculate wildly about what the Big-O time complexity of that code might be.
I think they would be in a hash. I'm not sure what algorithms would be used but if it has to go over each item I would guess linear time complexity.

@kaidamasaki
Copy link

Litter Patrol

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene 👍🏼
Comprehension questions 👍🏼

"React is for views, whereas Rails also comprises models and controllers."
This is close but isn't quite right. Part of the component can be thought of as Controllers, since there is some business logic there.

Also, while it's true that React would benefit from storing state efficiently, the rendering itself is what is going to require the most optimization.
Functionality
Clicking on litter or nature shows a check or X respectively 👍🏼
Clicking on litter appropriately updates the score 👍🏼
Under the Hood
JavaScript is well-organized and easy to read 👍🏼
Functions are named appropriately 👍🏼
Callback functions are passed to components appropriately 👍🏼
Overall Great job! Your code is clean and well organized and it looks like you've got a good understanding of handlers and callbacks.

Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! No notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants