What do you like least about C++?

This is a discussion on What do you like least about C++? within the C++ Programming forums, part of the General Programming Boards category; Header files is that thing for me. I hate that I need to create and maintain two files for every ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    890

    What do you like least about C++?

    Header files is that thing for me. I hate that I need to create and maintain two files for every non-trivial class.
    Last edited by medievalelks; 06-10-2008 at 07:38 AM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,904
    Implicit conversions. They are so evil that they're nearly useless when you want to overload operators such as operator T or operator bool.
    The fact that you can't make them explicit annoys me.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Technical Lead QuantumPete's Avatar
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    894
    This isn't going to be another one of those poll threads like in GD, is it?

    QuantumPete
    "No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
    "Have you tried turning it off and on again?" - The IT Crowd

  4. #4
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,751
    Quote Originally Posted by Elysia View Post
    Implicit conversions. They are so evil that they're nearly useless when you want to overload operators such as operator T or operator bool.
    The fact that you can't make them explicit annoys me.
    You can cast explicitly, but there is no other use for the explicit keyword apart from how it is applied to constructors.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,904
    Quote Originally Posted by citizen View Post
    ...but there is no other use for the explicit keyword apart from how it is applied to constructors.
    There isn't, and that's a shame.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by Elysia View Post
    Implicit conversions. They are so evil that they're nearly useless when you want to overload operators such as operator T or operator bool.
    The fact that you can't make them explicit annoys me.
    But I thought you like adding conversion operators to your classes? Did you change your mind?

    As for me, I'm not too fond of the whole C side of C++ and the inconsistencies.
    It would also be nice if all types had a standard size instead of leaving so much of the language as implementation defined.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,904
    Quote Originally Posted by cpjust View Post
    But I thought you like adding conversion operators to your classes? Did you change your mind?
    Yes, I do. But I've had to stop because they just keep causing too many problems.
    They never work as expected, so this is a major failing in the language.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,359
    They never work as expected, so this is a major failing in the language.
    Really? Wow. Color me lucky...

    As for me, I'm not too fond of the whole C side of C++ and the inconsistencies.
    Ditto.

    Soma

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,904
    Quote Originally Posted by phantomotap View Post
    Really? Wow. Color me lucky...
    OK, bad wording.
    They work in a lot of more unexpected ways than you think. They can easily introduce bugs or cause ambiguity, where this is undesired.
    If there was a way to control them better - such as explicit constructors, I'd be much happier.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    I dont like Herbie's teachings -- but I never read his books anyway.
    I'm just trying to be a better person - My Name Is Earl

  11. #11
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,359
    I dont like Herbie's teachings -- but I never read his books anyway.
    You do mean Schildt I hope?! O_o

    Soma

  12. #12
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,144
    You do mean Schildt I hope?! O_o
    swgh must be referring to Herb Sutter
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  13. #13
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    requiring goto to break/continue in nested loops

  14. #14
    Registered User
    Join Date
    May 2008
    Location
    Paris
    Posts
    248
    No default types for template arguments, mandatory specialisation of all arguments following a one which has been specialised. This latter point implies a profound reflection about the order of the template arguments, even before coding!, and which makes code much less maintainable....

  15. #15
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    Quote Originally Posted by laserlight View Post
    swgh must be referring to Herb Sutter
    Eeek. Blasphomy!
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

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

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