What is a "stub function"? Why are stub functions useful in the development process?
-
What is a "stub function"? Why are stub functions useful in the development process?
-
Answer:
A stub function does little or nothing. It allows you to write a program which calls the stub function without having to worry about making it work until later. It may fudge in a return value to allow the calling program to function. It's basically a placeholder.
76TYDRUVYWHW3VKDTQZJWGYYFM at Yahoo! Answers Visit the source
Other answers
Personally, for large development projects, they can be indispensable. You simply list out all the functions, or methods you will be using in classes or both, giving you the right file and a space in it to write the thing when you have to. That means you have a perfect opportunity to give yourself a gentle reminder with a couple of simple lines of code. int someFunctionGetsCalled() { cout <<"In function someFunctionGetsCalled, PROGRAM ME!" << endl; return 0; } Then, every time you build and run the other code that calls any of the stub functions, you get a nudge to remind you they exist and need attention. This is necessary because you will invariably need to adjust screen output, check for compile time or run time errors or just need to see that you're on track. Without some sort of stub function available, the code you're working on may have a dependency on a function you've not written, so it becomes a compiler error, *UNLESS* you have a stub function. Stub functions are always just the minimum you need for the language to accept it and, possibly, some screen output to remind you they are still stubs. I hope this adds to the idea. Good luck!
Dan
Related Q & A:
- How to access a nested function from another nested function in javascript?Best solution by devarticles.com
- What are “registry entries”, and why does a computer gradually slow down?Best solution by Yahoo! Answers
- What is a compound and why is it not a mixture?Best solution by Yahoo! Answers
- What is a codon and why are they important?Best solution by ChaCha
- What is a good free email service to use and why?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.