Thread: What do you like least about C++?

  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 06:38 AM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    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
    Location
    Inside my computer
    Posts
    24,654
    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
    Location
    Inside my computer
    Posts
    24,654
    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
    5,108
    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
    Location
    Inside my computer
    Posts
    24,654
    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,688
    I dont like Herbie's teachings -- but I never read his books anyway.
    Double Helix STL

  11. #11
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    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
    28,413
    You do mean Schildt I hope?! O_o
    swgh must be referring to Herb Sutter
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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,229
    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,318
    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"

Popular pages Recent additions subscribe to a feed