darkway-s / SE-Group10

0 stars 1 forks source link

Replace Boolean objects with primitive values #79

Open amandakrohn opened 2 years ago

amandakrohn commented 2 years ago

We mix Boolean objects (Boolean.FALSE, Boolean.TRUE) with the primitive types (true, false) and we should stick to one of them.

According to this very old thread thread it is better to use primitive types rather than the class. I do not know if using the Boolean class will pose any problems, but it is standard practice to use primitives.

BrorSebastianSjovald commented 2 years ago

We still need Boolean on generic types. Like creating a Matrix it needs to have a T of an object instead of a primitive type.

amandakrohn commented 2 years ago

That is a good point @BrorSebastianSjovald I did no think of that. Then I propose we should use objects only when necessary (e.g. not in tests or LIC-returns) and primitives otherwise.