← Back to Upcase

NEW: A programming challenge for Prime subscribers

(Ben Orenstein) #1

HI All!

We’re testing out a new idea for improving your Ruby skills: a programming challenge just for Prime subscribers.

Take a look here: https://github.com/thoughtbot/shakespeare_analyzer

This is a great way to practice your chops and also to get some feedback on code you’ve written. I listed the difficulty level as intermediate, but I’d love to see you all take a crack at it.

Questions? Post them here and I’ll update the README.


(Patrik Bóna) #3

This looks perfect!

There is also a contest for t-shirt, so what is the deadline for submitting our solutions?



(Ben Orenstein) #4

Good question!

Deadline for being considered for a t-shirt is 9/24/13.

(Chris Kuffo) #5

Really cool!

(Silas Sao) #6

Awesome. Will be doing this.

(Eric Lubin) #7

How crazy do you want to get counting ALL? should we figure out who is on stage at the time and add a line to their count? add one to everyone in the play? ignore those lines?

(Patrik Bóna) #8

Very good question! Those lines are tricky…

@benorenstein should we consider such lines?

<LINE>So all.</LINE>

(Ben Orenstein) #9

I wouldn’t worry too much about those lines. The point of the exercise is to practice TDD and your coding chops, not so much to get the exact right answer.

Just make a sensible decision about how to handle them and press forward.

(Jon Seidel) #10

Awesome idea - thanks! Hope you do more of these…jon

(Ben Orenstein) #11

Thanks! Given how good the response has been (lots of forks, lots of people leaving good comments on each others’ code), we’re planning to do more.

(Patrik Bóna) #12

Who is the winner? Who is the winner? Who is the winner? :smiley:

(Ben Orenstein) #13

The winner is @kmcgladdery!

Here’s his submission: https://github.com/thoughtbot/shakespeare_analyzer/pull/7

You can see my comments on his pull for why I chose his implementation. But to summarize:

  • nice division of responsibilities among classes
  • good division of responsibiliets within classes (lots of small methods)
  • good method names
  • good use of duck-typed injected dependencies (see xml_provider)

Kevin – would you like your shirt?

(Ben Orenstein) #14

Also, to clarify: this exercise is still open to anyone that would like to complete it. You just won’t be in the running for a t-shirt (unless you email me and ask very, very nicely).

(Patrik Bóna) #15

Congratulation to winner! Really nice solution!

@benorenstein I am looking forward to next challenge. This was a great exercise for me. Before it I had no idea how to tests standalone scripts with RSpec, how to download files, parse XML… So thanks!

(Ben Orenstein) #16

Glad you liked it! New exercises are definitely planned.

(Kevin McGladdery) #17

Yes, please. =)

And thank you very much. This was an excellent learning experience.

(Pedro Moreira) #18

Congrats @kmcgladdery :slight_smile:

Really enjoying reading studying all the solutions submitted and the good discussions in the pull requests. Hope I can actively participate in the next challenge

(Ben Orenstein) #19

Want to watch thoughtbot’s CTO solve this problem (with me providing color commentary)?

Check out this post: http://forum.thoughtbot.com/t/new-one-hour-tdd-screencast/1015

(Chad Pytel) #23