3 ms·
One of Java's weaknesses is that they _didn't_ move to everything is an object. Instead we still have all the primitive types (except unsigned, but that's anoth
by pkulak 5y ago
One of Java's weaknesses is that they _didn't_ move to everything is an object. Instead we still have all the primitive types (except unsigned, but that's another topic!) and they autobox to and from their object wrappers. I'm assuming moving to objects was considered and discarded for performance reasons. Now I guess we're getting inline classes soon? Which will solve the performance problem, but only decades later.
- astrange 5y agoI think by object he means "reference type" - the only good thing about Java's primitives is that at least it has some value types somewhere! Almost every decision in Java feels like it was chosen to waste memory. Even using less than int size ints is hard, because it makes you write explicit casts everywhere, which doesn't prevent bugs, but then makes overflow wrap silently, which encourages them.
- oriolid 5y agoYes, "everything is a reference type" describes better what I was thinking. And also, "functions are classes, not objects".