Like Tree7Likes

Anyone else think it's kinda weird...

This is a discussion on Anyone else think it's kinda weird... within the General Discussions forums, part of the Community Boards category; Originally Posted by Yarin This is wrong. You _do_ say "pointer to <value>", as well as, "pointer to <type>". While ...

  1. #31
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by Yarin View Post
    This is wrong. You _do_ say "pointer to <value>", as well as, "pointer to <type>". While this may not be correct in the most technical sense. It's what people say, because it's easier, and to say it in the long form is redundant considering you know what one means when they say that anyway.
    No you don't. I have never heard anyone EVER say "pointer to five". We have a pointer to an int, not a pointer to five. No one says "pointer to five". You could even say "pointer to myvar", but you would never say "pointer to <value myvar has>". No one does that.
    Quote Originally Posted by Yarin View Post
    But then... if you want to get all technically correct, then really, down the same line of thinking, saying "pointer to <type>" is also wrong. It's a "pointer to <said> location in memory".
    No it isn't. A pointer has to have a type associated, because the value of the memory address by itself tells us nothing (which is why you are forced to typecast void* when you want to dereference it.
    Quote Originally Posted by Yarin View Post
    This is explained by the fact that a "null pointer" is intended to be understood as _not_ pointing to an address, in essence _not_ pointing somewhere, or pointing nowhere, all in all, not functioning as a pointer is generally expected to, ergo a "null pointer". It's for this reason we don't say it's pointing to zero.
    Wrong again. A NULL pointer is specifically set to be a value to test against so you can know you have set a pointer to be "invalid". It doesn't actually have to be &0 by the way.
    Quote Originally Posted by Yarin View Post
    While a "five pointer" (that being (void*)5), is understood to function... as a pointer, that is point to somewhere, so yeah, of course calling it a "five pointer" wouldn't make sense.
    Like I said, no one says that.


    Quzah.
    Hope is the first step on the road to disappointment.

  2. #32
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by whiteflags View Post
    We all just like to argue.
    Do not not not!


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #33
    Registered User
    Join Date
    Jun 2005
    Posts
    6,618
    I won't debate whether people like to argue. It would sort of be like trying to convince a hurricane on whether it can or cannot change course.

    What appears to be true is that some people here like like to extrapolate to points of absurdity. For example, "Since I say <X>, everyone does" versus "Since I've never need <Y>, nobody has".

    I've yet to see any people (except one or two arguing for it here) describing a "pointer to value". More significantly, I've yet to encounter a programming language that requires, or even encourages, people to think that way.

    Under the assumption that my observations support a more general conclusion, I will continue.

    Compilers are often designed so they are quite pedantic in their interpretation of a programming language, ignorant of the intent of a programmer, and emit both verbose and cryptic error messages when they fail to understand code they are given. For this reason, it is usually a good idea for the programmer to describe things in a manner consistent with how things are described in their programming language of choice - it makes communication with the compiler easier. Similarly, when communicating with other people who use a programming language, it is also a good idea to describe things in a manner consistent with that programming language. Particularly as one cannot always be certain that another programmer speaks the same human language (English, german, russian, etc).

    On that basis, I would suggest describing something as "pointer to value" rather than "pointer to type" and "pointer contains address of value" is absurd.

    But that conclusion is based on several assumptions and, if members here like to argue, I am confident they will challenge both my assumptions and my conclusion.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Sunshine, and read this, this, and this before posting again.

  4. #34
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by grumpy View Post
    I've yet to see any people (except one or two arguing for it here) describing a "pointer to value". More significantly, I've yet to encounter a programming language that requires, or even encourages, people to think that way.

    Under the assumption that my observations support a more general conclusion, I will continue.

    Compilers are often designed so they are quite pedantic in their interpretation of a programming language, ignorant of the intent of a programmer, and emit both verbose and cryptic error messages when they fail to understand code they are given. For this reason, it is usually a good idea for the programmer to describe things in a manner consistent with how things are described in their programming language of choice - it makes communication with the compiler easier. Similarly, when communicating with other people who use a programming language, it is also a good idea to describe things in a manner consistent with that programming language. Particularly as one cannot always be certain that another programmer speaks the same human language (English, german, russian, etc).

    On that basis, I would suggest describing something as "pointer to value" rather than "pointer to type" and "pointer contains address of value" is absurd.
    I would agree, and so would this guy, as much as he doesn't want to:
    Quote Originally Posted by Yarin View Post
    While a "five pointer" (that being (void*)5), is understood to function... as a pointer, that is point to somewhere, so yeah, of course calling it a "five pointer" wouldn't make sense.
    There's a reason he had to add that cast.


    Quzah.
    Hope is the first step on the road to disappointment.

  5. #35
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,686
    Quote Originally Posted by quzah View Post
    There's a reason he had to add that cast.
    He he, that's true. I had incorrectly assumed that we were talking about a type-less pointer, all along. For that matter, I didn't consider any consequences of type in the first place.

    You say you haven't heard people say/write, "pointer to <value of type at location>". Well, I have. Yes, I agree, this is incorrect. Then again, ending sentences in prepositions is too.

  6. #36
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by Yarin View Post
    Then again, ending sentences in prepositions is too.
    I only use one language at a time. C it is!


    Quzah.
    Hope is the first step on the road to disappointment.

  7. #37
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Quote Originally Posted by quzah View Post
    I only use one language at a time. C it is!
    Quzah.
    See quzah, English isn't your first language! Clearly it was C.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  8. #38

    Join Date
    May 2005
    Posts
    1,041
    see quzah, english isn't your first language! Clearly it was c.
    cleanup on aisle *boom!*
    I'm not immature, I'm refined in the opposite direction.

  9. #39
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by BobMcGee123 View Post
    cleanup on aisle *boom!*
    We need one! Look at the magic post hiding out between #32 and #33.


    Quzah.
    Hope is the first step on the road to disappointment.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. kinda new need help
    By drkylec in forum C++ Programming
    Replies: 1
    Last Post: 03-09-2011, 03:30 PM
  2. kinda aggrivating me
    By guyfromfl in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 03-31-2008, 11:54 AM
  3. I'm kinda new to C++
    By DeanDemon in forum C++ Programming
    Replies: 9
    Last Post: 12-01-2002, 12:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21