Skip to content

Instantly share code, notes, and snippets.

Good stuff. Here are my notes on your code:

  • Your anagrams? method is sweet. You got this one 100%.
  • You chose to use map to iterate through each word in list_arr. This works, but it is a misuse of map. Why? Because map has a specific function: to iterate through an existing array, perform the same action on each object in the existing array, and return a new array that contains the resulting objects. Since you do not need to do this in your find_anagrams method, map is not a good choice.
  • BUT, your logic is sound. You are iterating through the list_arr, checking each objec

Nice work on this one. Here are my notes on your code:

  • Your factorial_iterative method does the job concisely, but not as concisely as possible. Specifically, your if condition only handles zero, but not 1. Since you already have if n == 0 you might as well catch 1 with this line also, so a good refactor would be if n <= 1. That way, if n is 1 you don't end up creating an array of [1] and running reduce on it.
  • Your reduce is super sharp. Sweet!
  • Your factorial_recursive method is short and sweet, and it takes care of 0 and 1
@philsof
philsof / code-review-pair-edwardgemson,mirascarvalone-active-record-associations-drill-shirts-challenge.md
Last active January 26, 2016 06:17
Code review: pair-edwardgemson,mirascarvalone branch for active-record-associations-drill-shirts-challenge

Good effort on this, you are thisclose! Here are my notes on your code:

  • When I go into the console and enter User.new for the first time, a new User is instantiated, but I also get this warning message: /Users/Phil/.../active-record-associations-drill-shirts-challenge/app/models/user.rb:10: warning: duplicated key at line 10 ignored: :through

    /Users/Phil/.../active-record-associations-drill-shirts-challenge/app/models/user.rb:12: warning: duplicated key at line 12 ignored: :through

This is because you are chaining through: statements on lines 10 and 12 of your User model. T

@philsof
philsof / code-review-pair-kb-diangelo,kerryimai-javascript-drills.md
Last active January 26, 2016 06:17
Code review pair-kb-diangelo,kerryimai-javascript-drills.md
@philsof
philsof / code-review-pair-scottychou-blog-1-anonymous-blog-challenge.md
Last active January 26, 2016 15:46
Code review pair-scottychou blog-1-anonymous-blog-challenge

Good work! Everything is solid except for what is mentioned below. So if it's not below, you are good. Here are my notes on your code:

##Views##

  • When I go to the edit form at http://localhost:9393/entries/:id/edit the body of the existing entry does not show in the corresponding input field. It looks like this is because you are utilizing a textarea tag in your entries/edit view. Heads up: It doesn't look like the textarea tag supports the value attribute, according to the docs. That would explain why the body doesn't show on the edit form. You will need to fix this, since the user will think the entry doesn't have a body at all (which is not true).
  • Watch out: Your entries/new view cannot handle a request from a user w
@philsof
philsof / code-review-pair-andy4626,lnagle93-design-drill-argument-order-dependency-challenge.md
Last active January 28, 2016 17:37
Code review pair-andy4626,lnagle93 design-drill-argument-order-dependency-challenge

Good work! Here are my notes on your code:

@philsof
philsof / code-review-pair-dthelouie,plonsker-parsing-data-1-csv-in-csv-out-challenge.md
Last active January 29, 2016 17:40
Code review pair-dthelouie,plonsker parsing-data-1-csv-in-csv-out-challenge

This does the job. Good work. Here are my notes on your code:

  • It looks like you unnecessarily separated the parsing work into two methods, your get_list method and your parse_people_objects_from_file method. All of this logic could be contained within parse_people_objects_from_file; there is no need to separate some of the logic into a get_list method. This is how you could combine both methods:

    def parse_people_objects_from_file
      csv_row_objects = []
      CSV.foreach('people.csv', headers: true) do |line|
        csv_row_objects.push(line)
      end
@philsof
philsof / code-review-world-s-simplest-browser-challenge-pair-dmandelb,plonsker.md
Last active February 2, 2016 00:49
Code review world-s-simplest-browser-challenge pair-dmandelb,plonsker 02-01-2016.md

Good work! Per your desire to sharpen your MVC skills, here are some detailed notes on your code:

  • You have a puts call in your Display class's initialize method. Instead, you are going to want your Controller to utilize your Display.look_at_this method to print this initial welcome text to the console:

    @viewer.look_at_this("Welcome to the World's Simplest Browser")

Or, you could write a specific Display method for this:

@philsof
philsof / code-review-pair-kb-diangelo,kerryimai-behavior-drill-style-editor-challenge-02-01-2016.md
Last active February 2, 2016 01:33
Code review pair-kb-diangelo,kerryimai behavior-drill-style-editor-challenge 02-01-2016

Good work! Your code does the job. Here are my notes on your code:

  • You are utilizing jQuery's on method for a click event on your form's submit button, which works. But there is a better way. Because we are dealing with a form's submit action, you could utilize jQuery's on method for a submit event, which would look like this:

    $('#style_editor').on('submit', function(event) {  //#style-editor is the id of the form

    Notice the submit event only requires you to locate the form (it automatically knows you are referring to the form's submit action). When binding event handlers to form submit actions, you are going to want to utilize this.

Note: You could also utilize jQuery's submit method directly.

@philsof
philsof / code-review-pair-edwardgemson,kerryimai-build-a-rails-blog.md
Last active February 10, 2016 20:55
Code review for branch pair-edwardgemson,kerryimai challenge build-a-rails-blog 2_10_16

Good work, here are my notes on your code: