Thread: <?= operator

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    Quote Originally Posted by Salem
    > from people trying to squeeze every second of time in their solutions.
    Gotta be a real moron to believe that the number of characters your program occupies has anything to do with the performance of the code.

    Do they really believe that since a <?= b takes fewer characters than a < b ? a : b, that the compiler will generate fewer compare instructions or branch instructions?
    Yes, you are correct; it is true that idiots exist. Either the programmer's an idiot, or the compiler creator is an idiot.

    If there is some programmer or compiler creator here that I've just insulted, this thread should take an interesting turn :-)

    Of course, these artifacts from nonstandardized days shouldn't be forcibly removed from compilers, so we're being a bit unfair.

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Gotta be a real moron to believe that the number of characters your program occupies has anything to do with the performance of the code.
    Actually, I'd say these people are MUCH smarter than me, and probably a bit smarter than you. They are squeezing seconds off of coding time, not running time.

    Take a look at this, for example [registration required].

    http://www.topcoder.com/stat?c=probl...696&cr=8355516

    The code is cryptic, but I don't think you nor I would solve the problem in 7 minutes.

    I actually have found that using <?= and >?= makes my code more buggy, since I somtimes omit characters and then do assignments or other similiar dumb stuff.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. unary operator overloading and classes
    By coletek in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2009, 02:14 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Operator Overloading (Bug, or error in code?)
    By QuietWhistler in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2006, 08:38 AM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM