Skip to content

Instantly share code, notes, and snippets.

@jasonpilz
Last active February 26, 2016 17:20
Show Gist options
  • Save jasonpilz/e9cd9321f3b5f3c9a549 to your computer and use it in GitHub Desktop.
Save jasonpilz/e9cd9321f3b5f3c9a549 to your computer and use it in GitHub Desktop.
A comparison of my first three js exercisms (excl. "Hello World") to those of other responders

##Leap My code: here

  • Responder #1 (here) - I like how Emily broke out individual methods to check each specific condtion. This would make the conditional methods more reusable.
  • Responder #2 (here) - I love how this person didn't explicitly return true or false; instead the conditionals return true / false.
  • Responder #3 (here) - This one is similar to the one above, but they used a ternary to return either true or false, which is not necessary.
  • Responder #4 (here) - Not a fan of this solution, indentation is crazy, also hard to read the conditional flow.
  • Responder #5 (here) - Interesting that this person stored the boolean in a variable...not sure I like this approach due to this being unnecessary.

##Hamming My code: here

  • Responder #1 (here) - I don't like in this solution how the check for string length equality is nested within the for loop, this doesn't make sense to me.
  • Responder #2 (here) - One thing I like about this is that the length of sequence if checked once, then used in the loop, instead of checked each time in the loop.
  • Responder #3 (here) - Line 6-8 in this solution seems unnecessary, since mutation_count will be returned as 0 anyway.
  • Responder #4 (here) - I like the use of reduce in this solution
  • Responder #5 (here) - Good to be aware that a solution like this will get tests passing, but best is to throw an actual error rather than just a truthy value.

##RNA Transcription My code: here

  • Responder #1 (here) - One thing I feel is not a good aspect of this approach is that the conversion model is built into the conversion logic flow, which would make it less reusable.
  • Responder #2 (here) - I like how this solution is very readable.
  • Responder #3 (here) - Aarons solution is clean and readable, and the complement map can easily be changed if needed.
  • Responder #4 (here) - This solution has a lot of duplication (two conversion hashes, two for loops), which I find confusing and unnecessary.
  • Responder #5 (here) - This solution uses a very specific set of conditionals that will only handle the given tests. I don't see what the point of writing a program like this is.
@rrgayhart
Copy link

Nice overview! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment