Talk:Method stub

I'm not sure if the second definition (stub = hack) is correct. I thought that a hack should actually work but a stub doesn't.

I agree that the second definition (contributed by the otherwise anonymous user who identified himself/herself as "MJ") seems wrong/off. I think this second usage is slippery and even slangy. A stub is more very specifically a temporary or stop-gap routine (or at least a skeleton of one--it could just return fixed output, for instance) deliberately used in development/testing whereas a hack is more likely to arise from necessity than convenience. (Hacks, kludges and workarounds all kind of have overlapping meaning/usage.) And a hack can take any form—whereas a stub kind of tends to imply a single routine / entry point.

Besides, since the entry is headed "Method stub" we should stick with the C.S. definition rather than sloppy, slangy interpretations. —Iguana Scales 20:27, 21 June 2006 (UTC)

I do not think it is a good idea to merge method stub with dummy code. At least not without merging mock object/method too. Since the stub differs from a mock in that it is stateless. But afaik both can be considered to be dummy code.

I absolutely love the fact that this article on stubs is itself a stub.

I hope this never changes. 82.2.153.188 23:05, 13 October 2007 (UTC)


 * LOL Stevebroshar (talk) 12:37, 4 May 2024 (UTC)

In my experience (java programmer) I associate a stub with Remote Procedure Calls. You talk to the stub (locally) as if it was the object that is actually on a remote location. Mock objects I associate with Integrationtest, you dont actually read the tables, but just create a mock object instead. —Preceding unsigned comment added by 194.151.20.69 (talk) 12:35, 13 November 2007 (UTC)

I use stub methods to mainly keep the flow of reasoning going while writing a program. For example, while writing a method I figure that I might need the next few lines for another similar method and instead of writing those few lines, I just write out a new method name and make a method stub. This helps me check for compilation errors, keep going with the flow of the current method as well as in Refactoring. I don't believe this use was mentioned in the article, however this might be an important use too. In my previous experience I have also found out that writing all the method stubs before actually sitting down to program helps me figure out the structure and flow of the program. Off course this kind of reasoning would be illogical and most likely be frowned upon for big software projects, but for small programs I have found this to be extremely useful. -G6mps (talk) 01:58, 10 February 2008 (UTC)

I don't think "citation needed" on the terms `Method stub` and `stub` is particularly useful. Why would you need to cite the existence of the title of the article itself? Chaim1221 (talk) 19:57, 26 October 2016 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified one external link on Method stub. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20090711150137/http://www.sizovpoint.com/2009/03/java-mock-frameworks-comparison.html to http://www.sizovpoint.com/2009/03/java-mock-frameworks-comparison.html

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

Cheers.— InternetArchiveBot  (Report bug) 03:49, 15 December 2017 (UTC)

More general name
IMO this article should have a more general name. A method stub is basically the same as a function stub and a procedure stub and so on. The core idea is: stub of a thing-that-is-callable. Sadly, there is no good term for thing-that-is-callable. I think callable is a good term, but since no one but me uses it, doesn't seems suitable for WP. It does seem that WP has chosen function as the one term to refer to the locus of this concept. Some possible names: Function stub, Stub (function), Stub (source code), Stub (callable) Stevebroshar (talk) 13:47, 4 May 2024 (UTC)

Scope creap
Seems that the focus of this article has mutated over time to include unrelated ideas from distributed computing and Windows OS. I moved them to a section called related, but they really should be removed from this article and possibly to a different article. Stevebroshar (talk) 13:51, 4 May 2024 (UTC)