Skip to content

Add new exercise pangram - #70

Merged
jtigger merged 1 commit into
exercism:masterfrom
matthewmorgan:new-exercise-pangram
Dec 14, 2015
Merged

jtigger merged 1 commit into
exercism:masterfrom
matthewmorgan:new-exercise-pangram

Conversation

@matthewmorgan

Copy link
Copy Markdown
Contributor

As described in xcommon #133.

This is my first PR to the Java track-- I hope I have everything set up right!

Comment thread pangram/src/test/java/PangramTest.java Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure what the other tracks look like, but I think it's odd to return an object of type Pangram that is .. not a pangram.

In terms of Java, I'd recommend instead something like

@Test(expected = IllegalArgumentException.class)
public void itRejectsEmptySentence() {
    Pangram p = Pangram.of("");
}

Or if you want to stick with an isPangram method, I'd stick with a static method on a Pangrams helper class.

@Test
public void itRejectsEmptySentence() {
{
    assertFalse(Pangrams.isPangram(""));
}

@sit

sit commented Dec 13, 2015

Copy link
Copy Markdown
Contributor

Nice! I'm not an active maintainer so please don't hold up on any of my comments, just making some suggestions on API design.

@matthewmorgan

Copy link
Copy Markdown
Contributor Author

@sit thanks for your feedback-- I think you make an excellent point.

As far as 'other tracks', this is a new exercise that has only been implemented three other times (and two of those were by me!) My implementations on the EcmaScript track and the JavaScript track were very similar to this one, and thus contain some of the same choices as far as design.

My intention was to do something more like your second suggestion, especially since it seems like testing for a Pangram is really the point, not creating Pangram objects.

The Python implementation is a more pure version of what I was trying to do, and very similar to what you are recommending it seems.

Anyway, check out this next version if you care to. Thanks again.

@jtigger

jtigger commented Dec 14, 2015

Copy link
Copy Markdown
Contributor

thanks for the contribution, @matthewmorgan !

I'll also give it a look over in the morning. I'm pretty familiar with the setup. It ought to be that if the build succeeds, you're good to go.

I did notice that your change set includes removing a starter solution from the word-count exercise. Could we do this in a separate commit, please?

Thanks!

@matthewmorgan

Copy link
Copy Markdown
Contributor Author

@jtigger The word count change was a mistake on my part. I was seeing a complaint about a duplicate class definition and thought I had somehow changed the word-count directory. In retrospect it makes no sense....

@jtigger

jtigger commented Dec 14, 2015

Copy link
Copy Markdown
Contributor

Thanks again, Mr. Morgan — looks great! You've been a regular contributor to this community, thank you so much for all your efforts.

Great adds, @sit. For a "not active maintainer" that's a lot of value add, right there. ;)

jtigger added a commit that referenced this pull request Dec 14, 2015
@jtigger
jtigger merged commit 1861692 into exercism:master Dec 14, 2015
@jtigger

jtigger commented Dec 14, 2015

Copy link
Copy Markdown
Contributor

Gotcha.

On Mon, Dec 14, 2015 at 2:59 AM, Matthew Morgan notifications@github.com
wrote:

@jtigger https://github.com/jtigger The word count change was a mistake
on my part. I was seeing a complaint about a duplicate class definition and
thought I had somehow changed the word-count directory.

—
Reply to this email directly or view it on GitHub
#70 (comment).

@matthewmorgan
matthewmorgan deleted the new-exercise-pangram branch December 16, 2015 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants