C++11 and third party libraries - big issues
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: C++11 and third party libraries - big issues

  1. #1
    Join Date
    Dec 2009
    Posts
    49

    C++11 and third party libraries - big issues

    I really think the C++ standard's commitee is doing it wrong. They move slowly and they decide to add important libraries 10 years later than they actually should have been added. And look what kind of a situation this has created.

    There are frameworks (MFC, Qt, etc) that have their own string classes, STL classes (Qt duplicates the STL - why oh why?), thread classes, networking classes. Where does std::thread fit in all this? Next they plan to standardize filesystem and networking libraries based on Boost.Filesystem and Boost.Asio - will probably take 5-10 years again.

    This strategy doesn't do any good. By the time they realize that it's time to add more standard libraries, there are tens of 3rd party libraries with the same functionality - and they usually don't integrate well.

    Languages like Java and C# seem to think about what the current trend is - programmers want to write networking code, let's offer them libraries to do it. With C++ it's like "Hey, people have been writing networking code for 30 years, every other languages has in-built support for it - it's about time we supported it too.".

  2. #2
    Join Date
    Aug 2008
    Posts
    902

    Re: C++11 and third party libraries - big issues

    Thank you captain hindsight? Are you just complaining about C++ and how Java is better?

  3. #3
    Join Date
    Dec 2009
    Posts
    49

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by Chris_F View Post
    Thank you captain hindsight? Are you just complaining about C++ and how Java is better?
    No, C++ is a nice language, but the standard's committee are doing it completely wrong. What kind of a strategy is this? To add libraries 20 years too late when every codebase out there uses 3rd party alternatives - just to create a mess.

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,885

    Re: C++11 and third party libraries - big issues

    If you want to write code which can be easily adapted to a future standard, use Boost. That's where most of the new standard libraries come from, after all. It makes sense to me to have a "proving ground" like Boost where the community can play around with concepts and iron out the wrinkles, before finally standardizing. I agree it takes ridiculously long though.

    Use of an alternative library is an intentional choice. Do you have a good reason for it? If so, cool, that reason is likely to still be valid even if a standard alternative becomes available.

    I agree that it's somewhat annoying to have to deal with all these libraries that do essentially the same thing; but at the same time, it's nice to have options. Not every library is going to do things in exactly the same way, and those minor variations are where you find innovation.

  5. #5
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,276

    Re: C++11 and third party libraries - big issues

    What you don't understand that some of the main consumer of C++ are industries, whose development cycles that can be decades (!) long. A lot of them have C code that were written 30 years ago that are still in production. Maybe standardization is slow, but it is stable. I'm still working on projects that don't support templates because our supplied compilers don't handle them.

    Java is how old again? And how many versions do we have? How many things that were original available in java are deprecated now? Does your java 1.1 code run with the java 1.6 JRE?

    Nobody said C++ development is fast or easy. But it has been working for 3 decades now. This is what the community is trying to preserve.
    Is your question related to IO?
    Read this C++ FAQ LITE article at parashift by Marshall Cline. In particular points 1-6.
    It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.

  6. #6
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    1,999

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by Bssldr View Post
    Languages like Java and C# seem to think about what the current trend is - programmers want to write networking code, let's offer them libraries to do it. With C++ it's like "Hey, people have been writing networking code for 30 years, every other languages has in-built support for it - it's about time we supported it too.".
    The problem with adding things too hastily is of course that you end up with deprecated stuff in the standard that needs to be supported forever even though there are better alternatives. Take a look at how many different approaches there are in C# to read an XML file. Having to figure out which of a handful of methods/approaches is still relevant certainly doesn't make a language easier to use IMO.
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

  7. #7
    Join Date
    Dec 2009
    Posts
    49

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by monarch_dodra View Post
    What you don't understand that some of the main consumer of C++ are industries, whose development cycles that can be decades (!) long. A lot of them have C code that were written 30 years ago that are still in production. Maybe standardization is slow, but it is stable. I'm still working on projects that don't support templates because our supplied compilers don't handle them.

    Java is how old again? And how many versions do we have? How many things that were original available in java are deprecated now? Does your java 1.1 code run with the java 1.6 JRE?

    Nobody said C++ development is fast or easy. But it has been working for 3 decades now. This is what the community is trying to preserve.
    The length of development cycles is totally irrelevant. If some industry wants to write code according to a specific standard, there's no one forcing them to use a newer compiler. However, there are people who like to write code in the present world, not in the past. Also, it's funny how most new projects are done in Java/C# and the industry seems to prefer productivity over outdated stable standards.

    I guarantee you, everything will eventually be added into C++ - I'd say by 2020 they'll be discussing about adding a GUI library. If they end up adding everything, why this delay? Why is the standard 10-20 years behind in time?

    I haven't written Java for a long time, but all class files for earlier JVM versions should run in the newer ones. And you can even compile for older JVMs using the 'target' option of javac. C++11 also deprecates quite a few things.

    EDIT:
    C++98. Were people writing multithreaded filesystem and networking aware applications at this time? Yes, yes, yes.
    *13 years of heavy mindwork*
    C++11. Only multithreading gets added.

    In fact networking (I think also filesystem) was dropped due to this ridiculous 13 year long mindwork, they just wanted to get done with the standard. It amazes me how this huge amount of members in the standard's committe can't do what smaller design teams do in a few years. If I'm not mistaken the C# (language only) design team consists of less than 10 people.
    Last edited by Bssldr; February 1st, 2012 at 12:05 PM.

  8. #8
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,885

    Re: C++11 and third party libraries - big issues

    What you may not be getting is that the C++ standard library is not meant to encompass every single bit of functionality. It is meant to provide a toolbox of useful things, but only to a point. Anything which is particularly specialized, you are supposed to find a 3rd-party library for.

    I don't think a GUI library will ever be standard, for instance.

  9. #9
    Join Date
    Dec 2009
    Posts
    49

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by Lindley View Post
    What you may not be getting is that the C++ standard library is not meant to encompass every single bit of functionality. It is meant to provide a toolbox of useful things, but only to a point. Anything which is particularly specialized, you are supposed to find a 3rd-party library for.

    I don't think a GUI library will ever be standard, for instance.
    I'm quite confident they'll eventually add a GUI library, but of course not 100% confident. They probably also thought in 1998 that they'll never add networking, filesystem, threading. I hope they'll do a better job on predicting the future from now on.

  10. #10
    Join Date
    Aug 2008
    Posts
    902

    Re: C++11 and third party libraries - big issues

    C++ better never have a standard GUI library purposed. C++ like C is meant to be portable to any system. I can compile C++ for a 8-bit microcontroller. How exactly is a GUI library supposed to be ported to that?

    If you want a language with a standardized way of doing everything from rendering GUI windows to wiping your tush, then stick with Java or C#. Java is a runtime environment and C# is based on .NET, which is a framework. C++ is simply a language and the standard library is simply a collection of useful tools, and I think you don't understand that.
    Last edited by Chris_F; February 1st, 2012 at 02:09 PM.

  11. #11
    Join Date
    Dec 2009
    Posts
    49

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by Chris_F View Post
    C++ better never have a standard GUI library purposed. C++ like C is meant to be portable to any system. I can compile C++ for a 8-bit microcontroller. How exactly is a GUI library supposed to be ported to that?

    If you want a language with a standardized way of doing everything from rendering GUI windows to wiping your tush, then stick with Java or C#. Java is a runtime environment and C# is based on .NET, which is a framework. C++ is simply a language and the standard library is simply a collection of useful tools, and I think you don't understand that.
    Perhaps the GUI example was a bit extreme, but I think you're stuck with the old definition of C++. C++ is nowadays rather an application programming language than a low level language for systems programming. Search around and see what is expected to be in TR2: networking, filesystem, xml support, etc.

    The problem is how the standard's committee works. When networking support is added, it's only a matter of time when they introduce a crypto library. But all this could have been done earlier. Would make more sense to introduce libraries when there's demand for them, not wait decades to realize that the standard library is in stone-age compared to other languages.

  12. #12
    Join Date
    Jan 2009
    Posts
    1,689

    Re: C++11 and third party libraries - big issues

    C++ is in heavy use in many many many many different systems. You forget that and think desktop and server code is dominating what C++ does. That's not the case, for every server that's running code written in C++, there is 10 embedded devices with c++ written code. Embedded devices rarely multitask, they rarely have file systems, they rarely do networking.

    Also, one of the major advantages to third party libraries is that their code gets used by everyone so they get optimized really well. Everyone uses the same zlib code for instance, whereas each compiler implements their own std::string. One codebase = fewer bugs, more optimized code. Remember VC++6's string implementation problem?

    And fyi, for most things there are not lots of third party libraries:
    networking: everyone uses libcurl
    threading: everyone uses pthread or Boost
    xml: everyone uses libxml2 or tinyxml
    graphics: everyone uses OpenGL or Allegro
    sound: everyone uses OpenAL
    pngs: everyone uses libpng
    movies: everyone uses ffmpeg

    There are one or two third party libraries that 99% of programmers use so they become the standard, it's not a huge cluster**** like you seem to be implying. C++ is a language, not a framework. Those are two very different things. FYI "java" is a language, it does not have any of the tools you mentioned. It comes with swing, which is a FRAMEWORK.

  13. #13
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,885

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by Bssldr View Post
    When networking support is added, it's only a matter of time when they introduce a crypto library.
    As soon as you add crypto to the standard, you get stuck with encryption methods needing to be in the library forever, even after they're broken and useless.

  14. #14
    Join Date
    Jan 2009
    Posts
    1,689

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by Lindley View Post
    As soon as you add crypto to the standard, you get stuck with encryption methods needing to be in the library forever, even after they're broken and useless.
    Good point, C++ is almost always backwards compatible. Very few things get deprecated, whereas java has loads of functions and classes marked as deprecated. I'm pretty sure the entirety of awt has been deprecated and replaced with swing (maybe its the other way around.) They will either some day take awt out and break tons of projects, or have to leave it in and start bloating java.

    There are also often cases where you want options. Some libraries are just designed for different things even though they offer the same functionality. Some libraries give you high level functionality but hide the details which makes it easy to use, but makes it rigid, some give you the basic chunks and you put them together yourself, which provides more flexibility. The good ones tend to offer both.

  15. #15
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,196

    Re: C++11 and third party libraries - big issues

    Quote Originally Posted by Chris_F
    C++ better never have a standard GUI library purposed. C++ like C is meant to be portable to any system. I can compile C++ for a 8-bit microcontroller. How exactly is a GUI library supposed to be ported to that?
    Easy: they just leave it out for the set of required libraries for freestanding environment implementations.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center