Forgot your password?
typodupeerror

Submission + - Is C++ The Right Tool? 8

ranton writes: I am about to start a personal project which I believe should be done in C/C++. The main reasons I have for this are the needs to manage memory usage and disk access at a very granular level and a desire to be cross-platform. Performance is also important but I am unlikely to spend enough time optimizing to be much faster than core libraries of higher level languages.

On the other hand, network access is also a critical part of the project and I am worried about the effort it takes to make cross platform code for both network and disk access. I have been working in the Java / C# world for the past decade and things like TCP/IP and SSL have just been done for me by core libraries. Do libraries like Boost or Asio do a good job of abstracting these aspects away? Or are there other options for doing granular memory and disk management with more high level languages that have better cross-platform library support? I am willing to brush up on my C/C++ skills if necessary but want to spend as much time as possible developing the unique and potentially innovative parts of my project. Thanks for any advice you can provide.
This discussion was created for logged-in users only, but now has been archived. No new comments can be posted.

Is C++ The Right Tool?

Comments Filter:
  • There are many cross-platform C/C++ packages out there. For example, the one that I use, QT provides network and disk IO classes. I've written code using network access as well as disk access with QT and have had no problem porting from Windows to Linux and back again. THere is a bit of a learning curve with QT, but it is worth the effort, in my opinion.
    • What about javascript guyz, it can do everything!

      Joking aside, I would like to third using Qt but I would look into it's smart pointers and garbage collector to make sure it won't interfere with what you are planning. Probably a pointless point to bring up but it never hurts to be as educated as possible.
    • by ranton ( 36917 )

      I had thought of QT as a GUI framework, but after a few people here have mentioned it I see it is another contender for a cross-platform C++ library to match my needs. Thanks for the info.

      Do you have any opinion on the benefits of QtNetwork vs Boost::Asio?

  • a second for QT

    it is very good at being usable on linux and windows and apple

    stay away from MICROSOFT'S C#
    there is the MONO project but....
    it is still really a one Operating System language

  • You don't need any toolkits. Just do your own thing. Seriously. Its not that hard to figure out and implement networking stuff.
    If you're worried about portability just stay Posix-compliant and you will be fine.

    QT is a giant pain in the ass. Any toolkit that needs its own custom compiler stage is insane.
    I'd strongly recommend totally avoiding QT. but if you really must use it, things to stay away from are signals and slots, and their data types, only use those things when you absolutely have to. This is doub

    • by ranton ( 36917 )

      Do you feel the same way about Boost::Asio as you do about QT? I am willing to do more low-level coding when necessary; I just want to spend as much time as possible on core functionality. Network code does scare me a bit since I don't remember doing socket programming fondly in the 90's, but I'm sure I could figure it out. I do love the idea of a library doing it for me, although don't want the library to spread too far into my code. I want to have strong control over concurrency and memory management and

      • by JustNiz ( 692889 )

        I can't talk about Boost with any real experience because I have not used it much, but sockets in C/C++ eally aren't that hard, especially if you write your own socket class in a generic way so going forward you can just use it everywhere and extend it as/when necessary. Thats what I did.

        Not only do you get to understand the low level stuff, you also have a useful component (and possibly the beginnings of your own tioolkit) that doesn't lock you into someone else's way of doing things and/or also requires y

        • by JustNiz ( 692889 )

          There's plenty of examples of C code for sockets all over the web... just be careful because some of it is relatively crappy, but you can easily see that just by comparison with other examples.

You had mail, but the super-user read it, and deleted it!

Working...