- screenshots of scores will be posted in comments
- screenshots of completed sections will be posted in comments
This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.
When complete, fill out this form.
For these questions, write a short snippet of code that meets
the requirement. In cases where the question mentions a "given"
data value, use the variable given
to refer to it (instead of re-writing
Create an app where users can favorite and comment photos.
(Photos have many comments, belong to many favorites)
rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
-d postgresql
sets up the project to use PostgreSQL--skip-turbolinks
& --skip-spring
creates a project that does not use turbolinks or spring-T
skips the creation of the test directory and use of Test::Unit
--api
will create a stripped-down Rails application with a smaller set of middleware. It will also configure the generators to skip the views/helpers/assets
and change the parent for ApplicationController
from ActionController::Base
to ActionController::API
####Sharing
####Authentication
####Twilio
I want to build an app that helps schools and families talk across language barriers about how to help students.
There is a growing English Language Learner population in America's public school system. Many of these families do not consistently maintain email accounts, but almost all of them use SMS. Educators need to be able to quickly communicate logistics and feedback to their students and families in multiple languages, but voice calling, individual text messaging are time consuming (especially if they need to be translated) and many families are just not accessible via email.
Tom argues that the role of the client and server are quite separate and thus necessitate their own applications. He states that by building an API and then a separate application that handles the views, it makes it easier to develop for mobile, improves performance, and makes code more maintainable.
I like the idea that we aren't fully harnessing the potential of the client computer. I also like the idea of spearating concerns.
I don't really disagree with anything, but there were two points that surprised me. First, he was pretty down on Angular. As a Google fan, that surprised me. Second, learning about his path from Genius Bar to developer was interesting. It seems like he saw it as pretty serendipitious.
##Leap My code: here
Responder #1 (here) - This responder used a multi-line if / else statement and did not extract out the 3 modulo operations into a separate function.
Responder #2 (here) - This responder used a ternary statement, but unnecessarily included a true / false return.
Responder #3 (here) - This user decided to build the logic out with a nested conditional, nesting the %100 and %400 checks within the %4 conditional. It appears cleaner at first glance and the nested structure does mirror the logic of the problem, though I know in a more complex situation a nested conditional could prove to be a real can of worms.
Responder #4 (here - This responder used thr