> On Tue, Jul 11, 2006 at 12:14:59AM -0700, Padraig
> O'Briain wrote:
> 
> > I have submitted patches to various projects to
> change references to string variables which could be
> NULL from
> > 
> > s to
> > 
> > s ? s : "NULL"
> 
> Why?  Other than debugging, what possible value does
> "NULL" have to
> users besides than alerting them to the fact that
> your software is
> buggy?

> On Tue, Jul 11, 2006 at 12:14:59AM -0700, Padraig
> O'Briain wrote:
> 
> > I have submitted patches to various projects to
> change references to string variables which could be
> NULL from
> > 
> > s to
> > 
> > s ? s : "NULL"
> 
> Why?  Other than debugging, what possible value does
> "NULL" have to
> users besides than alerting them to the fact that
> your software is
> buggy?

To play "Devil's Advocate" here, one could argue that printing "(null)" in 
certain scenarios is desireable. For example, in survey software, knowing the 
difference between a question that was left blank intentionally and a question 
that was not answered at all is important. Even databases often make the 
distinction between a field never having been set, having been set to a 
zero-length string.

However, in that case, I would expect the software to send "(null)" to printf, 
NOT a real NULL value -- it's just broken to me to expect a system API to 
accept bad data.

-Shawn
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to