Skip to content

Instantly share code, notes, and snippets.

@kamiboers
Last active June 26, 2016 21:32
Show Gist options
  • Save kamiboers/a5562b4289f86d757fc86eb3acd57e1c to your computer and use it in GitHub Desktop.
Save kamiboers/a5562b4289f86d757fc86eb3acd57e1c to your computer and use it in GitHub Desktop.

###Leap

###RNA Transcription

  • Ling's solution is way cooler than mine. I like the idea of using the dictionary variable and think that it makes for much less convoluted looking code.
  • This solution is the most similar to mine that I have seen. I think that I defaulted to case because of experience with long if/else methods in ruby, and though case isn't shorter, it does seem a bit clearer at times. The formatting of this response is easier to read, but I think that the variable is poorly named.
  • This solution is very similar to Ling's, but I like that they passed the character from the DNA strand directly into the translating dictionary. I thought that the dnaLength variable was extraneous, though.
  • This solution is a simple and straightforward use of if/else statements. It is very clear and easy to read.
  • This solution is the best that I was able to find, combining the dicitonary with regex to map over the DNA sequence, which is very clever without being unclear.

###Hamming

  • Sal's solution is a more condensed version of mine. I like that it's readable, and I could defintitely have named my variables better. Though it adds several lines to my code, I like immediately excluding strands that are the same.
  • Ali's code reminds me of doing this exercise in Ruby, because an immediate criticism that I received was about splitting the strands into characters. Though it absolutely makes human sense, I don't think that the extra step serves any purpose other than making it easier to imagine the strings concretely. Which is weirdly comforting, but inefficient.
  • This solution is almost exactly the same as the others listed, but I really disliked that s/he named the strands 'left' and 'right.' I found it confusing even though I knew what problem they were trying to solve. I should probably keep this in mind when naming variables unclearly.
  • Ling's solution broke more of the logic out into named methods, but I'm not sure that the result was much clearer than a simple and sequential if/else clause. I like the idea, though.
  • Josh's code - same comments as Sal's
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment