emilybache / Tennis-Refactoring-Kata

This is a Refactoring Kata based on the rules of Tennis
https://youtu.be/XifUs1FhWRc
MIT License
737 stars 1.27k forks source link

Question to difference in Pythonv vs Java/TypeScript/C# of TennisGame3 #118

Closed StephanSvoboda closed 1 year ago

StephanSvoboda commented 1 year ago

First of all thanks for the great collection of Katas

In TennisGame3 WonPoint(playerName) all languages I checked implement it like this:

WonPoint(playerName)
    if playerName == "player1"

So if in "production" we want to know the score of Nadal vs Djokovic Nadal will never score a point or better said each point Nadal scores is counted for Djokovic.

In Python it is different: if n == self.p1N

Is this difference intentional? Maybe to provoke the question if bugs should be fixed while refactoring.

emilybache commented 1 year ago

Hi, Glad you like that katas.

No it's not intentional, it's a translation error in the python version. I want there to be a bug with the player names as you indicate. It is important not to fix bugs while refactoring, unless you've agreed it with your users.

Emily

StephanSvoboda commented 1 year ago

I hope you will than accept my pull request to introduce a bug. (This feels wrong)