Getting rid of `new`?
On the Dotty-discussion front: there is a fascinating conversation going on, over on Scala Contributors, about the possibility of deprecating and eventually removed the keyword new
from Scala. The conversation has been winding along for a week or so now, and has actually gotten to the point of concrete proposals of how it might work.
On the one hand, I don’t think a change like this is essential — new
has been part of the language from the outset, and most folks just use it without comment.
OTOH, it’s clear that there is some latent demand for such a thing, from the common anti-pattern of case class
abuse: where people write a mutable class with lots of functions as a case class
, just so that they can avoid having to write new
. (I’ll wear my opinion on my sleeve here: case class
should be reserved for immutable data structures.)
So I’m of mixed minds here. Folks who are interested in the notion should check out the discussion…