java icon indicating copy to clipboard operation
java copied to clipboard

ledger: implement exercise

Open jmrunkle opened this issue 4 years ago • 1 comments

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.

jmrunkle avatar Apr 19 '20 04:04 jmrunkle

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.

github-actions[bot] avatar Sep 24 '21 03:09 github-actions[bot]

@jmrunkle I'd like to implement this exercise, is it still useful?

zankyr avatar Nov 09 '22 08:11 zankyr

Probably, but I have not been very active recently so you should check with the community of Java maintainers.

jmrunkle avatar Nov 09 '22 16:11 jmrunkle

@zankyr Go ahead, thanks for the help!

andrerfcsantos avatar Nov 12 '22 18:11 andrerfcsantos

@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.)?

zankyr avatar Nov 15 '22 15:11 zankyr

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 avatar Nov 17 '22 23:11 andrerfcsantos

@andrerfcsantos thanks, I'll update my solution with the provided suggestions.

zankyr avatar Nov 18 '22 08:11 zankyr