Closed OlofBen closed 9 months ago
Well "should" is a bit strong. It's rather that you can skip it if you want.
I'm hesitating if we should keep new or not in this exercise as it makes the allocation explicit and it is a prequel to next week's theme on classes. What do you think? We could keep new here and add a comment or so that new can be skipped.
You've got a point. However, the students have not seen the "new" keyword yet, so I think it can be a bit confusing for a new student. Removing new makes the syntax similar to initializing an Integer, which is more familiar for new students.
Actually they have seen new
- there is a part during the lectures about classes as a prequel in week objects before next week on classes, and the see with and without new etc, and we talk about allocation on the heap and draw clouds etc.
Oh, I missed that. Then I think we should leave it as it is.
Ok great. It is good if tutors explain what new
means during exercises.
New should not be used in Scala, except for in factory methods right?