[68cat][ide]Use new <classname>() instead of null for parameter guessing

View: New views
3 Messages — Rating Filter:   Alert me  

[68cat][ide]Use new <classname>() instead of null for parameter guessing

by Alied Pérez Martínez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all there, I hope have had a nice week-end.
I want to propose the use of new <classname>() instead of null in
parameter guessing, where there are no other options. Anyone else agree?

RE: [68cat][ide]Use new <classname>() instead of null for parameter guessing

by Matthies, Niklas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't think I agree, as it would almost never be the right thing in the code I write, and it would be more cumbersome to replace than "null" (where "mark word" can be used). At the very least, it should only be done if the type in question has an accessible default constructor. Even then, I'd rather not have that.

-- Niklas Matthies



On Mon, 26. Oct 2009 15:01, Alied Pérez Martínez wrote:
> Hi all there, I hope have had a nice week-end.
> I want to propose the use of new <classname>() instead of null in
> parameter guessing, where there are no other options. Anyone
> else agree?

Re: [68cat][ide]Use new <classname>() instead of null for parameter guessing

by Ulf Zibis-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

+1 (for Niklas)

-Ulf

Am 26.10.2009 15:19, Matthies, Niklas schrieb:

> I don't think I agree, as it would almost never be the right thing in the code I write, and it would be more cumbersome to replace than "null" (where "mark word" can be used). At the very least, it should only be done if the type in question has an accessible default constructor. Even then, I'd rather not have that.
>
> -- Niklas Matthies
>
>
>
> On Mon, 26. Oct 2009 15:01, Alied Pérez Martínez wrote:
>  
>> Hi all there, I hope have had a nice week-end.
>> I want to propose the use of new <classname>() instead of null in
>> parameter guessing, where there are no other options. Anyone
>> else agree?
>>    
>
>
>