finding when a pointer is set to NULL

Started by
60 comments, last by SagaEterna 21 years, 9 months ago
This topic was answered by the first and second posts. Can someone close it already?


Don''t listen to me. I''ve had too much coffee.
Advertisement
quote:Original post by Crispy

Is that the I-need-to-be-the-one-to-say-the-final-word syndrome?


No.


quote:Original post by Crispy

Are you attacking me? You can refer to me as "you", thank you very much, and address me directly.


You completely ignore the fact that you have no point , then you get offended because I am speaking about you to someone else in the third person. This is absolutely ridiculous.


quote:Original post by Crispy

PS - what exactly is the fact here?


Hmm...well, you could try reading the thread.


quote:Original post by Crispy

I personally prefer to use NULL over 0 in quite several occasions, one of them being the case of pointers. The reason why: I find any strings and numbers in code confusing. On the other hand, I never use NULL in loops and such.


Why do people form emotional attachments to their tools?


quote:Original post by Crispy

As to prejudice - I think it''s actually required in circumstances such as this, as otherwise the human brain wouldn''t be able to prefer one over the other and you''d end up beating your head to pulp, or starving to death or something because you simply cannot decide. So, yes, you could say I am prejudiced, and everyone here is, otherwise we wouldn''t be having this discussion, wouldn''t you agree?


That''s absolutely ridiculous. Prejudice is using personal opinions to deny reality; it''s quite different from mere personal preference.


quote:Original post by Crispy

The fact is: NULL can be used as an object of flexibility. It is not compulsory. If you feel that using NULL is outdated or whatever, don''t use it!! If you want to use NULL, do not listen to people - use it! That''s what it''s there for. After all, you''ll be the one to do the extra typing - what business is that of anyone else''s?!


You completely missed the point. Using NULL doesn''t buy you any flexibility compared to the literal zero because the behavior of literal zero will not change. Please read the posts before replying to them.


quote:Original post by Coward

Excuse me?

I''m sorry if you feel that I made fun of you by stating that (in my opinion) the 6 more keys to press is insignificant, it was NOT my intention...


First, Coward != Crispy, so don''t confuse yourself with my replies to him. Same goes for anybody else still reading this thread...

Second, nit-picking about irrelevant details is meant to discourage people from participating them in the argument by making them look foolish. The exact degree of extra typing is irrelevant; all that matters in the argument is that NULL is objectively several times more work to type.


quote:Original post by Coward

But NULL isn''t, remember zero is overloaded, and therefore, as an example, seeing an asignment to zero, can have two meanings (it could be an int/float/bool/whatever set to zero, or a pointer being marked as invalid), if you haven''t got the definition of the varibable you assign onhand...

Because of that, I like to use NULL for my pointers and zero for everything else, for clarity...


Hmph. I already responded to this in an earlier post.


quote:Original post by Coward

Did anyone tell you that you must use NULL?
If my posts here are so irrational, just ignore me...


You are not Crispy, remember? Crispy insinuated that I was somehow demanding that everyone use the literal zero, and I merely countered this insinuation. Before you butt into someone else''s arguments, please try to understand what they are talking about.


quote:Original post by Coward

Have I got problems with my code, since I write self-documenting code? Most likely...
Can I read C++ code? I can, but I''m dumb at it, and that''s why I like to tabulate it, put comments in it, use NULL for zero with pointers and whateverelse that takes atleast 8 times as many keystrokes as if I didn''t...
Am I a newbie? Yes, so what?!


*sigh* Calm down and we will go over the logic again. Experienced developers have no need of NULL. Which begs the question, why should newbies learn habits that will be of no practical use to them in the long term? Logically, it would be better to learn to use literal zero as a noob than to learn to use NULL and then have to relearn to use zero.


quote:Original post by Sneftel

This topic was answered by the first and second posts. Can someone close it already?


Hopefully so. I''m getting tired of responding to all these ridiculous accusations.

This topic is closed to new replies.

Advertisement