Skip to content

Instantly share code, notes, and snippets.

@Automatic365
Forked from anonymous/exercism.markdown
Last active October 13, 2016 15:07
Show Gist options
  • Save Automatic365/e08d4e46a50439347f58bf31f650f569 to your computer and use it in GitHub Desktop.
Save Automatic365/e08d4e46a50439347f58bf31f650f569 to your computer and use it in GitHub Desktop.

##Hello World My code: here

  • Responder #1 (here) - This responder used the absence of an input as the initial check for the if/else, which is the opposite of what I did, but the logic overall was almost exactly the same.

  • Responder #2 (here) - This person used a ternary statement, which is something that Mike strongly discouraged in Mod 1. Got everything in one line at the expense of readability.

  • Responder #3 (here) - This user decided to use the '===' to check if the input was empty, which I think is a little bit of an overkill for a check that simple. Otherwise, same logic.

  • Responder #4 (here) - This responder took an identical approach.

  • Responder #5 (here) - The final responder used an interesting approach. They kept the input check to one line using '||'. More readable than a ternary.

##Leap My code: here

  • Responder #1 (here) - This first response is much shorter than mine, and shows areas where I could have refactored. He used an or clause to keep everything on one line.

  • Responder #2 (here) - This person took an almost identical approach as responder # 1, but he explicity declared a variable first.

  • Responder #3 (here) - This approach is a hybrid of my code, and the simplified one line versions. This responder got most of the logic accomplished with an or clause, but used an explicit else to get the rest done.

  • Responder #4 (here) - This user's approach is very similar to the previous ones above, and I'm really understanding that I could have written simpler code.

  • Responder #5 (here) - See above, since the code is the same.

##Hamming My code: here

  • Responder #1 (here) - The first responder uses a very similar approach as I did, but throws an explicit error in a simpler way.

  • Responder #2 (here) - This approach is essentially identical to my own, which is boring.

  • Responder #3 (here) - This response accomplishes what the two previous responses did but manages to simplify the splitting with a forEach loop.

  • Responder #4 (here) - This response did not utilize split at all, which is interesting to me.

  • Responder #5 (here) - This final response is very similar to the first solutions above.

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