exercism / java

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

Karls Language introduces multiple concepts #2721

Open manumafe98 opened 8 months ago

manumafe98 commented 8 months ago

Currently the concept exercise Karls language introduces to the concepts Generics and Lists . But in the actual exercise you do not have a task regarding the generic concept, it's all focused on lists. I was thinking that we should create a separate exercise for the concept Generics or add a couple of new tasks to the exercise regarding generics.

sanderploegsma commented 8 months ago

Well there are generics in this exercise: the List type has a type argument.

One thing I do agree with is that the exercise could be expand on the generics part a bit, as it currently only works on List<String>. If it also required the student to work lists containing other types, like List<Integer>, it might teach the concept a bit better.

sanderploegsma commented 8 months ago

On an unrelated note: I'm not sure why the solution stub already has the private field hard-coded. It isn't required at compile time so it might be giving too much away already.

manumafe98 commented 8 months ago

I was thinking that instead of giving the methods straight away to the student, to have them implement them, and to have them build, expecting that the list is generic. For example:

// instead of giving this
    public boolean isEmpty() {
        return languages.isEmpty();
    }

// make them build this
    public boolean isEmpty(List<?> list) {
        return list.isEmpty();
    }