Slashdot Mirror


Ultra-Stable Software Design in C++?

null_functor asks: "I need to create an ultra-stable, crash-free application in C++. Sadly, the programming language cannot be changed due to reasons of efficiency and availability of core libraries. The application can be naturally divided into several modules, such as GUI, core data structures, a persistent object storage mechanism, a distributed communication module and several core algorithms. Basically, it allows users to crunch a god-awful amount of data over several computing nodes. The application is meant to primarily run on Linux, but should be portable to Windows without much difficulty." While there's more to this, what strategies should a developer take to insure that the resulting program is as crash-free as possible? "I'm thinking of decoupling the modules physically so that, even if one crashes/becomes unstable (say, the distributed communication module encounters a segmentation fault, has a memory leak or a deadlock), the others remain alive, detect the error, and silently re-start the offending 'module'. Sure, there is no guarantee that the bug won't resurface in the module's new incarnation, but (I'm guessing!) it at least reduces the number of absolute system failures.

How can I actually implement such a decoupling? What tools (System V IPC/custom socket-based message-queue system/DCE/CORBA? my knowledge of options is embarrassingly trivial :-( ) would you suggest should be used? Ideally, I'd want the function call abstraction to be available just like in, say, Java RMI.

And while we are at it, are there any software _design patterns_ that specifically tackle the stability issue?"

13 of 690 comments (clear)

  1. I'm gonna take a guess, but.. by Anonymous Coward · · Score: 5, Funny

    try not to de-reference any NULL pointers and you should be ok..

    1. Re:I'm gonna take a guess, but.. by Anonymous Coward · · Score: 0, Funny

      dammit, dammit, dammit!

      BRB

  2. Re:Get another programmer by Philip+K+Dickhead · · Score: 5, Funny

    Make sure his name is something like "Bjarne" or "Knuth".

    --
    "Speaking the Truth in times of universal deceit is a revolutionary act." -- George Orwell
  3. It's simple, really by eclectro · · Score: 3, Funny


    Use TPS reports. You'll thank me later.

    --
    Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
  4. +5 Funny by amling · · Score: 2, Funny

    I wish I could mod the article +5 Funny.

    --
    70e808a22cb027cde4a6abddf6435d55
  5. Forget it. by Pig+Hogger · · Score: 4, Funny
    Forget it, with C and C++.

    Those are low-level programming-jock languages disguised as high-level languages. As long as the punks who program them will have pissing contests in code obfuscation, you can count on having buffer overflows and memory leaks.

  6. Congratulations! Nice Work! by aendeuryu · · Score: 5, Funny

    "I need to create an ultra-stable, crash-free application in C++. Sadly, the programming language cannot be changed...

    From zero to flame war in under 20 words. Well done!

  7. Re:You're not the first one.... by asmussen · · Score: 4, Funny

    What? You need to use ones AND zeros??? Loser...

    --
    Shawn Asmussen
  8. Re:Yeah, c++ hasn't been successfully used before. by Lehk228 · · Score: 1, Funny

    write a perl interpreter in C++, then have the perl program stored in a string within the source file. that way it is still in c++.

    --
    Snowden and Manning are heroes.
  9. Obvious ! by Thomas+Miconi · · Score: 5, Funny

    What this guy really needs is the time-tested, tried-and-true Waterfall development process !

    Thomas-

  10. Ultra-stable? by Anonymous Coward · · Score: 1, Funny

    Ultra-stable, crash-free, and runs on Windows.

    Requirements like that make me glad I gave up programming to fish for salmon in Alaska.

  11. TSP is the answer. All Hail TSP. by diverscuba023 · · Score: 2, Funny

    Ah, but test driven development flies in the face of the new government backed, SEI approved software development silver bullet called TSP (Team Software Process). And by following TSP you too can consider just how much better it is than test driven development while waiting for your co-workers to inspect your code for a few months.

  12. Re:You're not the first one.... by synthespian · · Score: 4, Funny

    What, praytell, is the difference between a functional language like Haskell and a well-designed C++ template library?

    Referential transparency.
    That comp.lang.functional thread is interesting because there are guys from Ericsson elaborating on some real-world aspects of referential transparency. As you know, Ericsson uses the funtional programming language Erlang for their switches. See more in: Welcome to a Smarter Way of Programming. Of course, you can't take their use of Erlang seriously, because they're from Sweden, and Sweden, being a fucked-up third-world country with no tech at all, is not an example for America. The mighty AT&T pushed C++, and now the world is better, safer place, where software errors are a thing of the past.

    --
    Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts