####Turing's Eyewear Problem
- Former optometrist, pony trainer, magician, and pedal cabber
- 73% of adults under 30
#####Classes can be no longer than one hundred lines of code. #####Methods can be no longer than five lines of code. #####Pass no more than four parameters into a method. Hash options are parameters. #####Controllers can instantiate only one object. Therefore, views can only know about one instance variable.
In my opinion, the 5 line limit is the most difficult to follow. I think the key to adhering to the rule is overly-descriptive method naming so anyone reviewing your code can easily distinguish what is happening within the method.
I've been using presenters lately, and I think it really helps move logic down the stack. Especially when you want to generate random offsets or have minimal amounts of logic, it's nice to be able to stick it in a PORO away from the controllers. In addition, the super method you get from SimpleDelegator is extremely helpful when passing a service just for its methods.
Class limitations can be the hardest to practice, but are the most easily solved with modules.
Which sections were interesting?
Which sections did you totally skim?
Do you think the reading was valuable?
Respond in the comments of this issue with:
###Leap
######Response 1 The surprising aspect of this response is that there is no reference to else. She users an if statement and then closes her curly brackets, and then gets into the next condition without "else." I assume that JavaScript is smart enough to execute as if the statement is prefaced by "else."
######Response 2 No surprises here, very clean. I'm excited to hear why we need to add the final line "module.exports = Function"
#####Prep - example repo of CDN and file upload - gist for follow along #####Why this will save you an immense amount of time in future projects & make your future projects more valuable! (3 mins) #####Write 1 CSS skill you’d like to learn from this session on the board or +1 (3 mins) #####Materialize vs Bootstrap vs Semantic - (5 mins) - Cons - some bugs (ex: highlights wrong line in form, MIT license for students from Carnegie Mellon, not backed by Twitter like Bootstrap, much harder to find proper solutions on StackOverflow and other online sources - Pros - Unique from all other bootstrap sites, very approachable (good size of documentation), nice amount of jQuery animations, very clean tables #####Downloading into projects (15 mins)
###In broad strokes, summarize the event
(5) Intro
(15) Good CSS vs Bad CSS with examples
(5) Uploading into Projects
(15) Documentation
- see test_helper ActionController::TestCase for JSON.parse refactoring | |
- Need to reload the idea on an update ex: ideas(:one).reload before assertions | |
- see the idea.rb for validating inclusions | |
- head :no_content in delete action on ideas_controller? | |
- include Rails.application.routes.url_helper in integration tests? | |
- Does declaring vars at the top of a file give them global scope? Or is it for readability? | |
- event.preventDefault(); ? | |
- see the hassles of asynchronous code and multiple threats (complicated testing) | |
- IdeaRepository.all - is this Lo-Dash? |