? about stubs and skeletons

This is a discussion on ? about stubs and skeletons within the C++ Programming forums, part of the General Programming Boards category; Hi, I have a quick question concerning what skeletons and stubs are?? I have looked up the definitions, but still ...

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    15

    ? about stubs and skeletons

    Hi,

    I have a quick question concerning what skeletons and stubs are??

    I have looked up the definitions, but still am a little confused.

    My understanding of a stub is just a prototype of a function, the implementation of the function is not there.

    ex: void somefunction(int somethingelse);

    is this correct??

    And what does skeleton mean??

    Thanks for any explanations anyone can offer !!

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Thumbs up I use these techniques all the time!

    Heck, I use these techniques even though I'm not collaberating with anyone!

    I almost always start out with a skeleton of the function... even if it's only in that form for 5 minutes.

    It's a lot easier to debug your code if you can frequently test-compile and test-run what you have so-far.

  3. #3
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Its also a good idea to write out skeletons for classes/structs. For example, write out the prototypes for all planned functions (and function stubs), and include member classes, etc, before trying to completely implement any non-trivial function.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  4. #4
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    For that matter, it's a good idea to completely define all the interfaces (public and protected) for each class before you do anything else.

    I, too, often use stubs. For example, if I'm adding a "File Open" command, the first thing it usually does is to pop up a message box saying "File Opening -- to be implemented". This allows me to test the GUI without first implementing the full file read capability (file I/O tends to be more time consuming to write, and I like creating interfaces first as a rule).

    I tend to use "skeleton" as the minimal implementation of a program -- e.g. a program that compiles but does nothing useful. For example, a skeleton windows program might register a new window class, create a main window, start the message pump, and process the minimal set of messages. It's the sort of "boilerplate" framework from which you can implement a large number of programs.
    Last edited by Cat; 08-06-2003 at 06:12 PM.

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