java
java copied to clipboard
ledger: implement exercise
The exercise ledger has not been implemented yet for the Java track. The description of the exercise can be found in the problem specification repository.
How to implement a new exercise for the Java track is described in detail in CONTRIBUTING.md. Please have a look there first before starting working on the exercise. Also please make sure it is clear that you are currently working on this issue, either by asking to be assigned to it, or by opening an empty PR.
When opening an PR, please reference this issue using any of the closing keywords.
If you have had a look at the exercise description and you concluded that the exercise might not be possible to implement in the Java language, please leave a comment and describe the problem.
In case you have any further questions, feel free to ask here.
This issue has been automatically marked as action/stale
because it has not had recent activity. Please update if there are new updates to provide.
@jmrunkle I'd like to implement this exercise, is it still useful?
Probably, but I have not been very active recently so you should check with the community of Java maintainers.
@zankyr Go ahead, thanks for the help!
@andrerfcsantos Regarding this implementation, I have a doubt:
- does it make sense to use objects like
Locale
,Currency
,NumberFormat
- or, since the objective of the exercise is refactoring, the proposed solution must use simpler constructs (e.g. strings and their operations, like concat, replace, etc.)?
The second option. The less structure the code has, the better. The idea is for people to find the structure for the program they find adequate. Objects/classes like Locale
, Currency
and NumberFormat
is something that people should realize they need as part of the refactoring, but never imposed or even suggested.
Popular options for this exercise in other tracks are not even to try to divide the program into more than one function on the stub provided. A single giant function that does everything "manually" using no auxiliary functions or classes (other than the stdlib) is ideal. The worse the code, the better, because it more easily prompts people to make changes and makes it so they can improve things little by little.
@andrerfcsantos thanks, I'll update my solution with the provided suggestions.