Skip to content

Conversation

@JESii
Copy link

@JESii JESii commented Sep 15, 2013

File 'macbeth.output' file contains output from my program. I'm looking forward to your feedback!

@JESii
Copy link
Author

JESii commented Sep 15, 2013

Yep; back to the drawing board... I just realized that I'm supposed to count LINES of a speech, not just the number of times spoken. Thanks for pointing that out.

Was counting SPEAKER occurrences when needed to count LINES of each speech.
@JESii
Copy link
Author

JESii commented Sep 15, 2013

OK; now I'm counting lines of a speech...

Holding off on the 'ALL' speaker as don't know who to reliably tell who's on stage at the time it's used
@briantemple
Copy link

@JESii When first looking at your code, it did not appear that the check_input or get_http_file methods were being used. Clearly, that was my mistake, but I was curious about how you decided where to split the startup logic between lib/shakespeare_analyzer.rb and bin/shakespeare_analyzer.

Since the validation takes place in bin/shakespeare_analyzer perhaps all the validation logic could be localized in one place by moving over check_input / get_http_file?

Another option could be to have the initialize method be responsible for calling file validation, and throw an exception if the input was invalid and/or when analyze is called on invalid input. To me, it seems logical for the ShakespeareAnalyzer class to own its input validation and ensure it is run. As a bonus, that keeps all the code in one place and would just leave bin/shakespeare_analyzer as a shell to call ruby lib/shakespeare_analyzer.rb.

@JESii
Copy link
Author

JESii commented Sep 16, 2013

Great comments/questions, @briantemple ... thank you so much!

re: e058977 lib/shakespeare_analyzer.rb:L59 - Thanks for that Hash.new() usage; I'll definitely remember that!

re; e058977 lib/shakespeare_analyzer.rb:L56 - I looked at the 'ALL' usage and it depends on who's actually in the room; that means we'd have to find all the elements, search for the word 'Enter' and then pull the names of the folks who entered. We'd also have to look for the Acts/Scenes, because all characters leave at the end (Exeunt frequently). However, since it's not nicely formatted with an XML element, I steered away from that... That would really raise the complexity, IMO.

re: check_input / get_http_file - I actually pondered that a bit and wasn't sure if I'd come up with the best approach. I started off with everything all in the class... pretty procedural. Then, once I get it all working for the basic tests, I refactored out. I like your thought about the class 'owning' it's input validation. I had actually started to do that in the initialize method and moved it... I think I'll go back and review that section.

re: 352c76c lib/shakespeare_analyzer.rb:L42 - I see what you mean; however, I'm kind of a fan of 'nil' for things where I can't do anything... such as the case of no/wrong file. I've always felt that it left open a greater number of options. It may also be a holdover from my Perl background where the definition of true/false was broader than for Ruby.

Again, thank you for the thoughtful comments.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, didn't see this coming when I was doing the homework. Anyway, how did you discover this? It would be awesome if your tests somehow reflected this (i.e. you tease these things out by TDD, although not sure how that would be done).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a habit of reviewing the incoming data, separately from any TDD activities... gives me a feel for what things really look like and also helps me set up appropriate sample data. And so I found this condition and scanned the file to see what it looked like. My assessment was that the situation was not well-defined: I'd have had to parse the test in the directives to see who entered/left the scene, and also processed the directives to set actors on stage to nil. That's a very complex situation and not guaranteed to be correct. briantemple also raised that question and we got the word back from Thoughtbot to ignore that case.

Per suggestion from brian, move file validation/access into the initialize method;
now when using the class, you just instantiate it, call analyze to parse the file,
and then call the list_by... method to print the output.
Less dependence on the caller doing the right thing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of return points from this method. Makes me raise my eyebrows a bit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to avoid doing almost any work in initialize methods.

@r00k
Copy link
Contributor

r00k commented Sep 26, 2013

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

  • Extract more methods. Methods over 5 lines are almost always too long.
  • Worry about errors less.
  • Don't return nil when you can avoid it.
  • Only use comments when another programming would be surprised to see what you've done.

@JESii
Copy link
Author

JESii commented Sep 26, 2013

Ben... Thank you for the incredible amount of detailed feedback... Wow! I'll take a look over the weekend, refactor, and let you see what I come up with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected] wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

Extract more methods. Methods over 5 lines are almost always too long.
Worry about errors less.
Don't return nil when you can avoid it.
Only use comments when another programming would be surprised to see what you've done.

Reply to this email directly or view it on GitHub.

@r00k
Copy link
Contributor

r00k commented Sep 26, 2013

Glad it helped! Good luck with the refactoring.

On Thu, Sep 26, 2013 at 4:33 PM, Jon Seidel [email protected]:

Ben... Thank you for the incredible amount of detailed feedback... Wow!
I'll take a look over the weekend, refactor, and let you see what I come up
with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected]
wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

Extract more methods. Methods over 5 lines are almost always too long.
Worry about errors less.
Don't return nil when you can avoid it.
Only use comments when another programming would be surprised to see
what you've done.

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-25201321
.

@JESii
Copy link
Author

JESii commented Oct 3, 2013

Thanks again for the detailed feedback, Ben; definitely something for me to work on.

I do have one issue: You mentioned that you thought I was “a little paranoid” and should worry about errors less. I don’t agree with that. I learned a long time ago to practice defensive programming which has at least two benefits:

  1.   As a developer, I don’t get surprised when something blows up due to unexpected input/operation. It can still happen, but at least I’ve covered the bases as best I can in advance. It’s lack of defensive programming which has resulted in many of the errors in current-day programs: witness MS Windows and buffer overflow attacks as just one example.
    
  2.   As the end-user, at least there’s any explanatory message telling me what went wrong rather than just no response or strange results.
    

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Jon Seidel [mailto:[email protected]]
Sent: Thursday, September 26, 2013 1:34 PM
To: thoughtbot/shakespeare_analyzer
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer challenge (#5)

Ben... Thank you for the incredible amount of detailed feedback... Wow! I'll take a look over the weekend, refactor, and let you see what I come up with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected] wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

  • Extract more methods. Methods over 5 lines are almost always too long.
  • Worry about errors less.
  • Don't return nil when you can avoid it.
  • Only use comments when another programming would be surprised to see what you've done.


Reply to this email directly or view it on GitHub #5 (comment) . https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif

@r00k
Copy link
Contributor

r00k commented Oct 4, 2013

I think we'll have to agree to disagree here.

"As a developer, I don’t get surprised when something blows up due to
unexpected input/operation." I'm happy for things to throw exceptions when
something exceptional has happened. We have services to catch these and log
them for investigation.

"As the end-user, at least there’s any explanatory message telling me what
went wrong rather than just no response or strange results." For very
common errors, I think this is handy, but I think trying handle the rarer
stuff causes substantial obfuscation of the code for a small likelihood of
helping the end user.

On Thu, Oct 3, 2013 at 8:48 PM, Jon Seidel [email protected] wrote:

Thanks again for the detailed feedback, Ben; definitely something for me
to work on.

I do have one issue: You mentioned that you thought I was “a little
paranoid” and should worry about errors less. I don’t agree with that. I
learned a long time ago to practice defensive programming which has at
least two benefits:

  1. As a developer, I don’t get surprised when something blows up due to
    unexpected input/operation. It can still happen, but at least I’ve covered
    the bases as best I can in advance. It’s lack of defensive programming
    which has resulted in many of the errors in current-day programs: witness
    MS Windows and buffer overflow attacks as just one example.
  2. As the end-user, at least there’s any explanatory message telling me
    what went wrong rather than just no response or strange results.

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Jon Seidel [mailto:[email protected]]
Sent: Thursday, September 26, 2013 1:34 PM
To: thoughtbot/shakespeare_analyzer
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer
challenge (#5)

Ben... Thank you for the incredible amount of detailed feedback... Wow!
I'll take a look over the weekend, refactor, and let you see what I come up
with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected]
wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

  • Extract more methods. Methods over 5 lines are almost always too long.
  • Worry about errors less.
  • Don't return nil when you can avoid it.
  • Only use comments when another programming would be surprised to see
    what you've done.


Reply to this email directly or view it on GitHub <
https://github.com/thoughtbot/shakespeare_analyzer/pull/5#issuecomment-25199820>
. <
https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif>


Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-25647338
.

@r00k
Copy link
Contributor

r00k commented Oct 4, 2013

By the way, I think you'd like this book: http://www.confidentruby.com/

On Fri, Oct 4, 2013 at 10:49 PM, Ben Orenstein [email protected] wrote:

I think we'll have to agree to disagree here.

"As a developer, I don’t get surprised when something blows up due to
unexpected input/operation." I'm happy for things to throw exceptions when
something exceptional has happened. We have services to catch these and log
them for investigation.

"As the end-user, at least there’s any explanatory message telling me
what went wrong rather than just no response or strange results." For very
common errors, I think this is handy, but I think trying handle the rarer
stuff causes substantial obfuscation of the code for a small likelihood of
helping the end user.

On Thu, Oct 3, 2013 at 8:48 PM, Jon Seidel [email protected]:

Thanks again for the detailed feedback, Ben; definitely something for me
to work on.

I do have one issue: You mentioned that you thought I was “a little
paranoid” and should worry about errors less. I don’t agree with that. I
learned a long time ago to practice defensive programming which has at
least two benefits:

  1. As a developer, I don’t get surprised when something blows up due to
    unexpected input/operation. It can still happen, but at least I’ve covered
    the bases as best I can in advance. It’s lack of defensive programming
    which has resulted in many of the errors in current-day programs: witness
    MS Windows and buffer overflow attacks as just one example.
  2. As the end-user, at least there’s any explanatory message telling me
    what went wrong rather than just no response or strange results.

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Jon Seidel [mailto:[email protected]]
Sent: Thursday, September 26, 2013 1:34 PM
To: thoughtbot/shakespeare_analyzer
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer
challenge (#5)

Ben... Thank you for the incredible amount of detailed feedback... Wow!
I'll take a look over the weekend, refactor, and let you see what I come up
with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected]
wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

  • Extract more methods. Methods over 5 lines are almost always too long.
  • Worry about errors less.
  • Don't return nil when you can avoid it.
  • Only use comments when another programming would be surprised to see
    what you've done.


Reply to this email directly or view it on GitHub <
https://github.com/thoughtbot/shakespeare_analyzer/pull/5#issuecomment-25199820>
. <
https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif>


Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-25647338
.

@JESii
Copy link
Author

JESii commented Oct 5, 2013

Fair enough, Ben... I hear what you’re saying and I will keep it in mind.

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Ben Orenstein [mailto:[email protected]]
Sent: Friday, October 04, 2013 1:50 PM
To: thoughtbot/shakespeare_analyzer
Cc: Jon Seidel
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer challenge (#5)

I think we'll have to agree to disagree here.

"As a developer, I don’t get surprised when something blows up due to
unexpected input/operation." I'm happy for things to throw exceptions when
something exceptional has happened. We have services to catch these and log
them for investigation.

"As the end-user, at least there’s any explanatory message telling me what
went wrong rather than just no response or strange results." For very
common errors, I think this is handy, but I think trying handle the rarer
stuff causes substantial obfuscation of the code for a small likelihood of
helping the end user.

On Thu, Oct 3, 2013 at 8:48 PM, Jon Seidel [email protected] wrote:

Thanks again for the detailed feedback, Ben; definitely something for me
to work on.

I do have one issue: You mentioned that you thought I was “a little
paranoid” and should worry about errors less. I don’t agree with that. I
learned a long time ago to practice defensive programming which has at
least two benefits:

  1. As a developer, I don’t get surprised when something blows up due to
    unexpected input/operation. It can still happen, but at least I’ve covered
    the bases as best I can in advance. It’s lack of defensive programming
    which has resulted in many of the errors in current-day programs: witness
    MS Windows and buffer overflow attacks as just one example.
  2. As the end-user, at least there’s any explanatory message telling me
    what went wrong rather than just no response or strange results.

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Jon Seidel [mailto:[email protected]]
Sent: Thursday, September 26, 2013 1:34 PM
To: thoughtbot/shakespeare_analyzer
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer
challenge (#5)

Ben... Thank you for the incredible amount of detailed feedback... Wow!
I'll take a look over the weekend, refactor, and let you see what I come up
with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected]
wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

  • Extract more methods. Methods over 5 lines are almost always too long.
  • Worry about errors less.
  • Don't return nil when you can avoid it.
  • Only use comments when another programming would be surprised to see
    what you've done.


Reply to this email directly or view it on GitHub <
https://github.com/thoughtbot/shakespeare_analyzer/pull/5#issuecomment-25199820>
. <
https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif>


Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-25647338
.


Reply to this email directly or view it on GitHub #5 (comment) . https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif

Remove unnecessary start/end processing messages
Have empty file simply return and empty result so it's handled without exception.
JESii added 3 commits October 5, 2013 10:09
Use <<-EOF instead of <<EOF for greater clarity.
Correct order of result lines '2 persona, no speaking' test.
Cleanup <<-EOF spacing for improved readability
Changed commented-out test to use 'xit' so that it shows as pending.
Replace hacky initialize file handling code with a checked_file_for_open() method which returns a @file variable
which can be safely passed to the Nokogiri/open handling. If an unreadable file, then we raise an error.
Able to remove much of the old initialize code entirely and better show the intent of the analyze method.
@JESii
Copy link
Author

JESii commented Oct 5, 2013

First off, Ben, thanks very much for the link to Confident Ruby – I definitely liked Avdi’s presentation and am buying the book/video package.

Secondly, I better understand where your previous comments came from. Looking at the Confident Ruby stuff, it seems clear to me that error handling is still there, it’s just handled in a much clearer fashion than I was doing. I still believe that checking for error conditions is A Good Thing, but now it’s encapsulated and doesn’t get in the way of the overall flow.

I updated much of the file-handling in my latest push to github, using a checked_file_for_open() method which handles the various options, throws an appropriate error, and incidentally cleaned out a lot of the initialize() cruft. I’d appreciate your thoughts on the updates; I plan to do more from what I’ve learned from the book.

Thanks again...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Ben Orenstein [mailto:[email protected]]
Sent: Friday, October 04, 2013 1:52 PM
To: thoughtbot/shakespeare_analyzer
Cc: Jon Seidel
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer challenge (#5)

By the way, I think you'd like this book: http://www.confidentruby.com/

On Fri, Oct 4, 2013 at 10:49 PM, Ben Orenstein [email protected] wrote:

I think we'll have to agree to disagree here.

"As a developer, I don’t get surprised when something blows up due to
unexpected input/operation." I'm happy for things to throw exceptions when
something exceptional has happened. We have services to catch these and log
them for investigation.

"As the end-user, at least there’s any explanatory message telling me
what went wrong rather than just no response or strange results." For very
common errors, I think this is handy, but I think trying handle the rarer
stuff causes substantial obfuscation of the code for a small likelihood of
helping the end user.

On Thu, Oct 3, 2013 at 8:48 PM, Jon Seidel [email protected]:

Thanks again for the detailed feedback, Ben; definitely something for me
to work on.

I do have one issue: You mentioned that you thought I was “a little
paranoid” and should worry about errors less. I don’t agree with that. I
learned a long time ago to practice defensive programming which has at
least two benefits:

  1. As a developer, I don’t get surprised when something blows up due to
    unexpected input/operation. It can still happen, but at least I’ve covered
    the bases as best I can in advance. It’s lack of defensive programming
    which has resulted in many of the errors in current-day programs: witness
    MS Windows and buffer overflow attacks as just one example.
  2. As the end-user, at least there’s any explanatory message telling me
    what went wrong rather than just no response or strange results.

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Jon Seidel [mailto:[email protected]]
Sent: Thursday, September 26, 2013 1:34 PM
To: thoughtbot/shakespeare_analyzer
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer
challenge (#5)

Ben... Thank you for the incredible amount of detailed feedback... Wow!
I'll take a look over the weekend, refactor, and let you see what I come up
with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected]
wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

  • Extract more methods. Methods over 5 lines are almost always too long.
  • Worry about errors less.
  • Don't return nil when you can avoid it.
  • Only use comments when another programming would be surprised to see
    what you've done.


Reply to this email directly or view it on GitHub <
https://github.com/thoughtbot/shakespeare_analyzer/pull/5#issuecomment-25199820>
. <
https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif>


Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-25647338
.


Reply to this email directly or view it on GitHub #5 (comment) . https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif

JESii added 2 commits October 6, 2013 06:09
Raise 'Unreadable file' if error getting http file
Minor cleanup on get_http_file method.
Remove stub code for speaker=ALL; not handled.
Remove default file=nil in initialize.
@r00k
Copy link
Contributor

r00k commented Oct 8, 2013

Hey Jon,

I think this is getting better, but I still see lots of error checking
co-mingled with your logic (L53 for example).

Keep reading and pushing. :)

On Sat, Oct 5, 2013 at 2:55 PM, Jon Seidel [email protected] wrote:

First off, Ben, thanks very much for the link to Confident Ruby – I
definitely liked Avdi’s presentation and am buying the book/video package.

Secondly, I better understand where your previous comments came from.
Looking at the Confident Ruby stuff, it seems clear to me that error
handling is still there, it’s just handled in a much clearer fashion than I
was doing. I still believe that checking for error conditions is A Good
Thing, but now it’s encapsulated and doesn’t get in the way of the overall
flow.

I updated much of the file-handling in my latest push to github, using a
checked_file_for_open() method which handles the various options, throws an
appropriate error, and incidentally cleaned out a lot of the initialize()
cruft. I’d appreciate your thoughts on the updates; I plan to do more from
what I’ve learned from the book.

Thanks again...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Ben Orenstein [mailto:[email protected]]
Sent: Friday, October 04, 2013 1:52 PM
To: thoughtbot/shakespeare_analyzer
Cc: Jon Seidel
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer
challenge (#5)

By the way, I think you'd like this book: http://www.confidentruby.com/

On Fri, Oct 4, 2013 at 10:49 PM, Ben Orenstein [email protected]
wrote:

I think we'll have to agree to disagree here.

"As a developer, I don’t get surprised when something blows up due to
unexpected input/operation." I'm happy for things to throw exceptions
when
something exceptional has happened. We have services to catch these and
log
them for investigation.

"As the end-user, at least there’s any explanatory message telling me
what went wrong rather than just no response or strange results." For
very
common errors, I think this is handy, but I think trying handle the
rarer
stuff causes substantial obfuscation of the code for a small likelihood
of
helping the end user.

On Thu, Oct 3, 2013 at 8:48 PM, Jon Seidel [email protected]:

Thanks again for the detailed feedback, Ben; definitely something for
me
to work on.

I do have one issue: You mentioned that you thought I was “a little
paranoid” and should worry about errors less. I don’t agree with that.
I
learned a long time ago to practice defensive programming which has at
least two benefits:

  1. As a developer, I don’t get surprised when something blows up due to
    unexpected input/operation. It can still happen, but at least I’ve
    covered
    the bases as best I can in advance. It’s lack of defensive programming
    which has resulted in many of the errors in current-day programs:
    witness
    MS Windows and buffer overflow attacks as just one example.
  2. As the end-user, at least there’s any explanatory message telling me
    what went wrong rather than just no response or strange results.

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Jon Seidel [mailto:[email protected]]
Sent: Thursday, September 26, 2013 1:34 PM
To: thoughtbot/shakespeare_analyzer
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare
Analyzer
challenge (#5)

Ben... Thank you for the incredible amount of detailed feedback... Wow!
I'll take a look over the weekend, refactor, and let you see what I
come up
with.

Btw, great presentation at gogaruco!

Cheers... Jon

Sent from my iPhone

On Sep 26, 2013, at 1:13 PM, Ben Orenstein [email protected]
wrote:

Good effort!

Overall thoughts: you're on the right track, but I'd like to see you:

  • Extract more methods. Methods over 5 lines are almost always too
    long.
  • Worry about errors less.
  • Don't return nil when you can avoid it.
  • Only use comments when another programming would be surprised to see
    what you've done.


Reply to this email directly or view it on GitHub <

https://github.com/thoughtbot/shakespeare_analyzer/pull/5#issuecomment-25199820>

. <

https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif>


Reply to this email directly or view it on GitHub<
https://github.com/thoughtbot/shakespeare_analyzer/pull/5#issuecomment-25647338>

.


Reply to this email directly or view it on GitHub <
https://github.com/thoughtbot/shakespeare_analyzer/pull/5#issuecomment-25729323>
. <
https://github.com/notifications/beacon/R_jmgpfh-Dl35zqLlFcAJts90TaMcTIc3pkbPwqtlRfKtm98-yeF7swIfiOoMQC5.gif>


Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-25754657
.

@JESii
Copy link
Author

JESii commented Oct 8, 2013

Thanks, Ben... I only did the one cleanup to see how it would work; I like it! I’ll work on more now :=)

Cheers...jon

Jon Seidel, CMC®

Effective Decisions... Priceless!

From: Ben Orenstein [mailto:[email protected]]
Sent: Tuesday, October 08, 2013 10:28 AM
To: thoughtbot/shakespeare_analyzer
Cc: Jon Seidel
Subject: Re: [shakespeare_analyzer] Pull request for Shakespeare Analyzer challenge (#5)

Hey Jon,

I think this is getting better, but I still see lots of error checking
co-mingled with your logic (L53 for example).

Keep reading and pushing. :)

@r00k
Copy link
Contributor

r00k commented Oct 8, 2013

Ah, sorry. I misread. Didn't realize you'd just done the one. Onward!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants