exercism / java

Exercism exercises in Java.
https://exercism.org/tracks/java
MIT License
698 stars 682 forks source link

Make class names the exercise names if makes sense #2734

Closed manumafe98 closed 9 months ago

manumafe98 commented 9 months ago

After this PR, I started checking the class names and messages we pass to the students. And found a couple of class names that do not match the exercise name, and does not make sense for me at least:

AryanAmin commented 9 months ago

If this issue is ready to work on, can I work on this issue?

manumafe98 commented 9 months ago

hey @AryanAmin I would like to hear a couple of opinions after you can start working with this one, mainly the @sanderploegsma one

sanderploegsma commented 9 months ago

My 2cts:

The reason these classes were named this way may have to do with the fact that the exercises have been forked from other tracks like the C# track, and the original exercise used those class names.

Additionally, since Java generally promotes object-oriented design, the classes in the exercise are named after logical entities. For example: design-wise it makes more sense to have a class named Badge, as each class instance models a unique entity. This makes sense:

Badge badge1 = new Badge();
Badge badge2 = new Badge();

However, this doesn't really make sense:

TimFromMarketing timFromMarketing1 = new TimFromMarketing();
TimFromMarketing timFromMarketing2 = new TimFromMarketing();

The trend on Exercism is to provide concept exercises with a catchy and funny name ("Tim From Marketing" may sound more fun than "Badge Printer"), but IMO naming classes after each exercise is not always the way to go.

manumafe98 commented 9 months ago

@sanderploegsma I guess then this issue can be closed, thanks!