exercism / java

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

Adding analyzer feedback for karls language concept exercise #2722

Closed manumafe98 closed 5 months ago

manumafe98 commented 5 months ago

pull request

closes #2678

To be consistent with lasagna design.md, I made a couple of changes, so instead of using a loop make the user reuse code seem better for me.

Reviewer Resources:

Track Policies

manumafe98 commented 5 months ago

I have also a couple of questions:

manumafe98 commented 5 months ago

If we 100% want to make for-loops a prerequisite we could replace the last method isExciting that currently for me seems pointless for something like this

    public <T> String isInstanceOf(List<T> list) {
        for (T element : list) {
            if (element instanceof Integer) {
                return "Integer";
            }
        }
        return "String";
    }

And introduce the concept instanceof

sanderploegsma commented 5 months ago

Also seeing the hints file, and checking other files we are using documentation of different versions on java, we don't have a standard, I was thinking that we could maybe create a variable and assign it to the latest version, so the documentation that the student has is always updated? I'm open to ideas

How would that work exactly? AFAIK we can't define variables in Markdown files.

sanderploegsma commented 5 months ago

If we 100% want to make for-loops a prerequisite we could replace the last method isExciting that currently for me seems pointless for something like this

    public <T> String isInstanceOf(List<T> list) {
        for (T element : list) {
            if (element instanceof Integer) {
                return "Integer";
            }
        }
        return "String";
    }

And introduce the concept instanceof

Nah I think removing the for-loops prerequisite is the way to go here, the concept is really not needed for this exercise. Also based on the community solutions almost nobody uses a loop for the last task.

manumafe98 commented 5 months ago

How would that work exactly? AFAIK we can't define variables in Markdown files.

Yeah, I thought that the variables accept plain text, but it seems that they only accept URLs. However, I still think we should find a way to handle this, because currently, we have a ton of documentation for different Java versions – 7, 8, 9, 11, 12, 13, 14, etc. Perhaps a policy to only add documentation for the latest current version, but that wouldn't eliminate the need to update the older ones at some point.

sanderploegsma commented 5 months ago

How would that work exactly? AFAIK we can't define variables in Markdown files.

Yeah, I thought that the variables accept plain text, but it seems that they only accept URLs. However, I still think we should find a way to handle this, because currently, we have a ton of documentation for different Java versions – 7, 8, 9, 11, 12, 13, 14, etc. Perhaps a policy to only add documentation for the latest current version, but that wouldn't eliminate the need to update the older ones at some point.

Can you add a new issue to discuss this?

manumafe98 commented 5 months ago

Can you add a new issue to discuss this?

Sure