Thread: Shorten Statements are WRONG?!

  1. #16
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Strictly C++

  2. #17
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Wow, that eliminates lots of operators:

    +=
    -=
    *=
    /=
    %=
    &=
    |=
    ^=
    <<=
    >>=

    Bummer ...

  3. #18
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    I wonder if she likes:
    i++;
    and ++i;

    Or prefers:
    i = i + 1;

    Hmm ...

  4. #19
    ˇAmo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    RoD, the thing about main was sarcasm.

  5. #20
    you forgot your [sarcasm] tags!

    ~Inquirer
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

  6. #21
    ˇAmo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    Eh, oh well.

  7. #22
    Registered User
    Join Date
    Oct 2002
    Posts
    32
    It's simple, look at this as an "employee - employer" relationship so to speak. Though we all know the usage of += works great and ISN'T bad form, your teacher (ie: employer) doesn't want it that way. Get used to being told what style to code in. Either present your argument or just deal with it and move on with your life and code how your teacher wants you to. If your teacher agrees with your argument great, if not oh well deal with it.

  8. #23
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Suprisingly she uses i++.....

  9. #24
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by Ride -or- Die
    yea well the iostream header file is kinda needed there dude :P
    What I meant was that there's a difference between <iostream> and <iostream.h>
    But lots of books still use the wrong one, so perhaps that's not a big mistake.

    Why don't you post some code written by her so we can collectively flame it?
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  10. #25
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    Seems like she doesn't know much. Our teacher "crapped" on our heads when when didn't use the "*=" way.

  11. #26
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    >> Suprisingly she uses i++.....

    Too bad i++ isn't as efficient as ++i.
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

  12. #27
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    weight *= .88 is not bad because of the *= but it's
    bad because it implies somewhere before you had
    weight set to a value that wasn't the weight.
    I would have to see all of the code to see if it's bad style
    or not.

  13. #28
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Originally posted by Sang-drax
    What I meant was that there's a difference between <iostream> and <iostream.h>
    But lots of books still use the wrong one, so perhaps that's not a big mistake.

    Why don't you post some code written by her so we can collectively flame it?
    Well i have yet to find a M$ compiler that will let me use iostream without the .h on it, seriously.

    As far as the flame code i'll have to find some, and as far as the entire code to this proggy i'll type it in @fter school.

  14. #29
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Originally posted by Ride -or- Die
    Well i have yet to find a M$ compiler that will let me use iostream without the .h on it, seriously.
    MSVC++ 6.0 is four years old and supports <iostream>.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  15. #30
    Seeking motivation... endo's Avatar
    Join Date
    May 2002
    Posts
    537
    Originally posted by Divx
    It's simple, look at this as an "employee - employer" relationship so to speak. Though we all know the usage of += works great and ISN'T bad form, your teacher (ie: employer) doesn't want it that way. Get used to being told what style to code in. Either present your argument or just deal with it and move on with your life and code how your teacher wants you to. If your teacher agrees with your argument great, if not oh well deal with it.
    Thats a good point, as long as his coding style is clearly defined before he hands in work
    Couldn't think of anything interesting, cool or funny - sorry.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 04:09 AM
  2. newbie question - if statements without conditions
    By c_h in forum C++ Programming
    Replies: 2
    Last Post: 07-18-2008, 10:42 AM
  3. Efficiency of case statements
    By Yasir_Malik in forum C Programming
    Replies: 26
    Last Post: 05-23-2006, 11:36 AM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. whats wrong with my if statements
    By ssjnamek in forum C++ Programming
    Replies: 8
    Last Post: 01-29-2002, 12:48 AM