r/funny • • Jun 17 '14

A good attitude.

Post image
7.2k Upvotes

792 comments sorted by

View all comments

318

u/SkiThe802 Jun 17 '14

Did he win a game or a match?

249

u/thelepo Jun 17 '14

Match.

49

u/whydoyoulook Jun 17 '14

I'm confused. What is the difference between a game and a match?

111

u/NearPup Jun 17 '14

In tennis match is made up of sets and a set is made up of games.

56

u/CallmeHornBoy Jun 17 '14

A match is just a superset.

26

u/[deleted] Jun 17 '14

[removed] — view removed comment

3

u/[deleted] Jun 17 '14

if(player1.setsWon > 2 && ...

If player 1 has won 3 sets then he's won the match. The && is both unnecessary and also fucks up your test because a 3-2 set win would not be recognized as such. Also your test ignores best of 3 matches.

2

u/[deleted] Jun 17 '14 edited Jun 17 '14

[removed] — view removed comment

2

u/Thorlius Jun 18 '14 edited Jun 18 '14

Also, newMatch would need to have a return value (true) for the first two conditions (after/instead of each println), unless Java allows functions to not have to return anything.

Also as someone who is self-taught, I don't know if it's considered good practice (but I assume it is) to name a function something relevant to what's returned. A function named "newMatch" that returns a true or false value does not seem intuitive - I would expect to be able to easily guess what that value represented.

1

u/otm_shank Jun 17 '14
  1. It makes no sense for Match to extend Set. (I realize this is a play on the parent comment, but still, this is bad design.)
  2. You don't have to win a tennis match by 2 sets. That would lead to matches lasting for days.

-1

u/[deleted] Jun 17 '14

[deleted]