Talk:Method stub

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

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)[reply]


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)[reply]


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)[reply]


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[1]. 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)[reply]


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)[reply]

External links modified[edit]

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:

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

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 18 January 2022).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

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