std.allocator needs your help

Paulo Pinto pjmlp at progtools.org
Tue Sep 24 09:55:55 PDT 2013


Am 24.09.2013 18:14, schrieb Andrei Alexandrescu:
> On 9/24/13 9:12 AM, Paulo Pinto wrote:
>> Am 24.09.2013 17:29, schrieb Andrei Alexandrescu:
>>> On 9/23/13 11:32 PM, Jacob Carlborg wrote:
>>>> On 2013-09-23 19:53, Andrei Alexandrescu wrote:
>>>>
>>>>>
>>>>> I think this is debatable. For one, languages such as Java and C++
>>>>> still
>>>>> have built-in "new" but quite ubiquitously unrecommend their usage in
>>>>> user code. Far as I can tell that's been a successful campaign.
>>>>
>>>> Since when is it _not_ recommended to use "new" in Java?
>>>
>>> http://goo.gl/KVmAom
>>>
>>>
>>> Andrei
>>>
>>>
>>
>> The top results are from around 2002, when most JVMs still had basic GC
>> implementations and did not perform escape analysis.
>
> I'm having in mind the polymorphism/flexibility argument. I'd forgotten
> about the efficiency argument.
>
> Andrei

Ah ok. There I agree with you.

The common trend is to favour interfaces for behaviour and make use of 
dependency injection instead of new.

--
Paulo


More information about the Digitalmars-d mailing list