Talk:K-d tree: Difference between revisions

→‎C Entry: NULL is preferred
(→‎C Entry: stylistic things)
(→‎C Entry: NULL is preferred)
Line 68:
 
: 3) The <code>typedef</code> is indeed unneeded. My habit is <code>typedef struct {} sometype_t</code> and <code>typedef struct {} *sometype</code>, where <code>_t</code> says it's a struct, and lacking of it means a pointer. This may make pointers to pointers easier to write (<code>sometype *p</code> instead of <code>sometype_t **p</code>), but is certainly not necessary. I'll drop the <code>typedef</code>s here, but I doubt it will make the code more or less readable. --[[User:Ledrug|Ledrug]] 21:34, 26 April 2012 (UTC)
 
:: FWIW, I agree strongly with using <code>NULL</code>; it's more ''idiomatic'' and says that “we're thinking about the pointer that does not point”. It's really a code-smell thing; if someone's mixing things up, you've got to examine ''every'' use of <code>0</code> to figure out what's going on. (This isn't the same as when you're working in your own code, but we want the very best of style here as each language understands that concept.) –[[User:Dkf|Donal Fellows]] 08:25, 5 June 2012 (UTC)
Anonymous user