Skip to content

Conversation

@matthewlee07
Copy link
Contributor

No description provided.

end
counter.order_book_by_count
counter.render_book
end
Copy link
Member

Choose a reason for hiding this comment

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

I haven't seen this strategy before. Typically folks will give all the file content to the object and then ask for a report. Something like:

corpus = File.read('speech.txt')
counter = Count_Words.new(corpus)
puts counter.words

But I don't mean to imply there's anything wrong with your approach. Reading the file one line at a time is great for really big files.

If you feel like practicing more, you could try switching approaches. This is pretty awesome as-is, though. Let me know if you would like any additional guidance.

@matthewlee07
Copy link
Contributor Author

I have my apprenticeship interview with CMM tomorrow. Do you think a solution like this would be acceptable, or is it better to go with your recommendation? And is there anything else that'd help prepare me?

@mikegee
Copy link
Member

mikegee commented Feb 26, 2019

Do you think a solution like this would be acceptable, or is it better to go with your recommendation?

Either way is really ok. It's just important that you can justify the decision. What are the pros and cons of each approach? What kinds of future changes would be easy to handle in the code versus needing to rethink the approach? Does it need to handle multi-gigabyte inputs or streaming inputs?

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.

2 participants