Re: why use -> (not .) with pointers?



In article <42c428a3$0$304$7a628cd7@xxxxxxxxxxxxxxxxxxxxx>,
Guillaume <"grsNOSPAM at NOTTHATmail dot com"> wrote:
>When I see so many programmers mixing integers and fp numbers in
>expressions without quite knowing what they are doing (and sometimes
>wondering why the heck they don't get the results they are expecting),
>I'm thinking: why not different operators. At least, that would force
>you to have a clear understanding of both what you want and what is
>going to happen, without having to read dozens of pages of the standard
>and praying that your compiler sticks to it...

An alternative would be to not do silent type conversion in expressions --
except perhaps (for convenience) for some forms involving constants.

If there is no operator for int + float then the programmer would
have to put in explicit type casts as necessary, thus forcing the
programmer to pay attention at each substep to the types.


Such a scheme might do interesting things to expressions such as
toupper(HexChar) - 'A' + 10
due to the signed-ness ambiguity of char...
--
Warning: potentially contains traces of nuts.
.



Relevant Pages

  • Re: Enforce instruction ordering?
    ... sequence of expressions including] ... trignonometric identities that are valid in the real numbers ... that I've ever run into has done transformations of this kind, ... which is ordinarily not a concern for a C programmer but may ...
    (comp.lang.c)
  • Re: optimizing an expression
    ... Can you lay off "the isn't worthy of being called a programmer" ... I can comprehend the writing of JK Rowling and James Joyce, ... and in simple expressions it can be much ... and the only gain is a little less typing. ...
    (comp.lang.c)
  • Re: proper way to include constants; as module or include file?
    ... > expressions. ... What is the proper way to offer this file? ... my perl file is compromised of constants such as the ... > And a programmer would use my constants like so: ...
    (comp.lang.perl.modules)
  • Integer division, surprising results
    ... As an old C programmer, I'm surprised by some results I'm getting with ... integer division. ... I expect the results of these expressions to be 0 and -4, ... Michael Cornelius ...
    (comp.lang.python)
  • Re: why use -> (not .) with pointers?
    ... expressions without quite knowing what they are doing (and sometimes wondering why the heck they don't get the results they are expecting), I'm thinking: ... have to put in explicit type casts as necessary, thus forcing the programmer to pay attention at each substep to the types. ...
    (comp.lang.c)