Skip to content

Instantly share code, notes, and snippets.

@MsJennyGiraffe
Forked from anonymous/exercism.markdown
Last active October 13, 2016 04:46
Show Gist options
  • Save MsJennyGiraffe/70e714b6191e11a5254e5f5fde0d4608 to your computer and use it in GitHub Desktop.
Save MsJennyGiraffe/70e714b6191e11a5254e5f5fde0d4608 to your computer and use it in GitHub Desktop.

##Leap My code: here

  • Responder #1 (here) - This responder used nesting if else/statements. Personally, I would rather have longer code than nested code, but because there aren't very many conditions, I think that it doesn't matter too much. It's still fairly easy to follow. I wish the responder would take out the hello world comments just because it pushes down code and makes it harder to directly compare when switching tabs. I do like that this responder takes in input, I took in year, which makes it kind of confusing when Year takes a year.

  • Responder #2 (here) - This responder made a one line if conditional, which I'm not always opposed to, but I don't like when I have to scroll to see code, and I have to scroll sideways to see it on the website. I think the logic is clean, and I like it. I just wish it was a little shorter.

  • Responder #3 (here) - I think this responder is my favorite one. By declaring the variable of the input on a line and then putting the logic all on one line, it's incredibly easy to see, I don't have to scroll and everything is very readable. Nailin' it.

  • Responder #4 (here) - This looks like the same solution to responder one. It has the nested if I'm not a fan of, but still, it's pretty easy to understand what's going on. I acutally think the first responder may have copied this responder because every other solution I've seen has Year taking year but this one is taking input.

  • Responder #5 (here) - This looks exactly like responder two. There's scrolling necessary to see everything, and there is an else condition of false. All of these have pretty much the same logic.

##Hamming My code: here

  • Responder #1 (here) - This code is fairly similar to mine in concept, but instead of using a for loop like I did, this responder used a forEach. In this case, I don't see a huge difference between using an enumerable and a for loop, it seems to do about the same thing. I think this responder's came out a little cleaner than mine. I think both could use improvement though.

  • Responder #2 (here) - I don't think this person knew that strings could have their length counted so there's a little bit of messy, and unneeded code trying to split the strings. Other than that, other than variable names and slightly different syntax, our code is essentially the same. I feel like this person could work a little on variable naming.

  • Responder #3 (here) - If the previous responder and my codes had a baby, this is what it would look like. There's not much to say because it's so similar. It uses an interesting method of charAt, which the name gives me an idea of what it does, but I didn't know it was a thing, so this was a learning experience.

  • Responder #4 (here) - I don't know if it's trendy to look at recent submissions or if this is just a logical way of solving it, but there seems to be a consistency to these solutions. This responder did leave some console.logs in their code though, which I would say shouldn't be there for submission. They use Array.from which I think would be something like split, but I don't know what it does, so it's another learning experience, but I also do not think this is necessary.

  • Responder #5 (here) - This answer is at least different. That being said, I have little idea of what's going on. I don't think this responder read the readme because she named some variable alphabet. There's also an x and y, which tells me nothing of what that acutally is. There are nested if statments with for loops inside. It is not intuitive and hard to understand.

##RNA Transcription My code: here

  • Responder #1 (here) - This approach uses an if statement to determine the four cases and concatinates it into a string. I'm not a huge fan of this approach because I feel as though it's not very dynamic and would get very long if more letters were incorportated, which I know isn't a huge issue because dna and rna are pretty set. They also don't use prototype to make a new method, which I assume isn't great. But it is simple, and I can easily see what's going on so I like that.

  • Responder #2 (here) - This approach is slightly different, and uses a case statement. It uses arrays and joins like mine does. I really don't like the variable naming and even though I just did this exercise I have to think to know what it's talking about. But as with the first responder, I don't like the if/case statements in order to define what's being returned.

  • Responder #3 (here) - This I don't even want to look at. There's a not going on, and I believe unnecessarily. It uses a for loop to go through the different characters instead of using an enumerable to go over it.

  • Responder #4 (here) - This one is simpler than the last. It uses a for loop to concatinate the strings, but it's pretty dense. I'm not used to seeing if statements on one line in JavaScript. I can easily see what's going on, but I still don't like the common method of using string concatination with if statements and for loops.

  • Responder #5 (here) - This responder has a similar, but I think a little better approach than mine. He uses the hash like object literal in the constructor to declare what the letters are supposed to be an iterates over with a map, whereas I used a forEach. I think his is how I would have done it if I were better at thinking of what to do.

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