2 ms·
Constructors are tools to put an object in a starting state, but there's alternative solutions; in Go, factory functions are pretty common. Primitive types rem
by Cthulhu_ 4y ago
Constructors are tools to put an object in a starting state, but there's alternative solutions; in Go, factory functions are pretty common.
Primitive types reminds me of Java, which doesn't have primitive types per se (everything is an object under water), but they're adding it soon (or already have) for performance reasons.
- jolux 4y agoJava does have primitives/unboxed types (int, long, boolean, etc) what they’re adding is support for unboxed/value classes created by users. This should help reduce the duplication between int and Integer and so forth.