> First you criticise Java, then you bring up a point which (usually) is not a very big concern in garbage-collected languages.
Of course it is for a number of reasons (instance sharing or reusing, caches, registries, ...), and most GC'd languages (significantly, not Java or C#) give separate access to these two operations (allocating an instance and initializing it).
See Ruby (new/initialize), Python (__new__/__init__), Obj-C (alloc, init), etc...
Of course it is for a number of reasons (instance sharing or reusing, caches, registries, ...), and most GC'd languages (significantly, not Java or C#) give separate access to these two operations (allocating an instance and initializing it).
See Ruby (new/initialize), Python (__new__/__init__), Obj-C (alloc, init), etc...