Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The remainingMinutesInOven method should reuse the logic implemented in expectedMinutesInOven" should take into account fields of the class. #218

Open
Filnaei opened this issue Sep 13, 2024 · 3 comments

Comments

@Filnaei
Copy link

Filnaei commented Sep 13, 2024

Hello there!
I got the recommendation I put into the title for this exercise. I think this recommendation seems to be wrong. The method remainingMinutesInOven() is a getter method, as it only returns a predefined value.
Do you really reuse getter methods in other class methods to use said value?
Storing the value in a field and using said field in other classes seems to be the more effecient way in my eyes and is thus a slightly misleading recommendation, I think.
image

@Filnaei
Copy link
Author

Filnaei commented Sep 13, 2024

I did not notice that this thread is not exercise specific.
I am referring to this exercise: https://exercism.org/tracks/java/exercises/lasagna/

@kahgoh
Copy link
Member

kahgoh commented Sep 16, 2024

Hi @Filnaei, that's an interesting one. I think we were expecting expectedMinutes to simply return 40 directly instead of using a field. Using a field does seem valid here though. @manumafe98 what do you think about this one?

@drnoah
Copy link

drnoah commented Oct 26, 2024

Considered calling method instead of returning 40 minutes but in the end perfect solution is to have lasagne oven time as Constant. So this doesn't make expectedMinutesInOven a getter just a very simple method. Simplicity of this task kinda make it look weird but I assume you are making your automatic mentor reusable and not doinbg different things based on simplicity. So it is good.

Just my 5 cents

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

No branches or pull requests

3 participants