Skip to content

Conversation

@shreve
Copy link

@shreve shreve commented Nov 27, 2013

No description provided.

app.rb Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably extract this URL into a constant. I tend to do this for most "magic" values like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I doesn't look like @app needs to be an instance variable. I'd probably make it just a local if so.

Copy link
Author

Choose a reason for hiding this comment

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

Why should the URL be a constant?

The change I'm imagining would be

MACBETH_URL = "http://www.ibiblio.org/xml/examples/shakespeare/macbeth.xml"
HAMLET_URL = "http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml"
macbeth_analyzer = ShakespeareAnalyzer.new MACBETH_URL
hamlet_analyzer = ShakespeareAnalyzer.new HAMLET_URL

I guess I don't see the value.

@r00k
Copy link
Contributor

r00k commented Dec 19, 2013

Good effort!

I left some comments inline.

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