DEV Community

Discussion on: Roast the code #1 | Rock Paper Scissors

Collapse
 
jordanjlatimer profile image
jordanjlatimer

I really like your code! It’s easy to read and follow what’s going on.

Honestly, the only thing I can see that you could improve are kinda nit picky, but hey, at least I have something for you.

In your abstract GameUi class, all of your methods are verbs except for “initialMessage”, which is a noun. I would change that to “displayInitialMessage” or some over verb-like name for consistency.

Same with the “whoWins” method in Ruleset class, and the “divider” method in your CliUi class.

The “isWinner” method of the Rule class feels weird to me. Maybe because it doesn’t make sense for a rule to be a “winner”? I don’t know, it could just be me.

Anyway, great work!

Collapse
 
nombrekeff profile image
Keff

Thanks for the feedback and the kind words!

In your abstract GameUi class, all of your methods are verbs except for “initialMessage”, which is a noun. I would change that to “displayInitialMessage” or some over verb-like name for consistency.

I really like this suggestion, I'm all in for this kind of changes!

The “isWinner” method of the Rule class feels weird to me. Maybe because it doesn’t make sense for a rule to be a “winner”? I don’t know, it could just be me.

I totally agree, funnily enough I had a really difficult time finding a better name for the "isWinner" method, so I decided to let that one slip until I found a better name. Do you have any suggestions?