strange operator

This is a discussion on strange operator within the C++ Programming forums, part of the General Programming Boards category; Did nobody notice the '<- Rhetorical' in my post ... no? >> easily infer what a= min(a,b) meant, while a<?=b ...

  1. #16
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Did nobody notice the '<- Rhetorical' in my post ... no?

    >> easily infer what a= min(a,b) meant, while a<?=b is not nearly so obvious.
    True true. But, while it isn't obvious, it is ... (somewhat) decipherable if you know how to use the ? : operator and know about < and > than's.
    Last edited by twomers; 08-21-2006 at 04:53 PM.

  2. #17
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,581
    That operator is definitely one of those that illudes me. Probably there is some explanation for it other than just "it is quicker to write". However let it be said that the operator is more commonly used in this form:

    int low = x <? y;

    Which probably better shows the advantages. Less typing, less prone to bugs, more easily debuggable just from looking at the code.

    All in all, we could extend this conversation to operators like ->, ->* and the compound assignment operators which invariably are nothing more than a shorthand to ease on the code and make things more readable and consequently easier to debug.
    Last edited by Mario F.; 08-21-2006 at 05:24 PM.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strange problem with operator overloading
    By misterowakka in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2008, 11:18 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 08:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  4. strange linking error with operator overloading
    By George2 in forum C++ Programming
    Replies: 7
    Last Post: 07-03-2006, 08:32 AM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-07-2003, 12:51 AM

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