java icon indicating copy to clipboard operation
java copied to clipboard

Karls Language introduces multiple concepts

Open manumafe98 opened this issue 1 year ago • 3 comments

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.

manumafe98 avatar Feb 05 '24 20:02 manumafe98

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 avatar Feb 05 '24 20:02 sanderploegsma

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.

sanderploegsma avatar Feb 05 '24 20:02 sanderploegsma

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();
    }

manumafe98 avatar Feb 05 '24 21:02 manumafe98