Revision3.com Shows Schedule Inside Revision3 Store


Go Back   Revision3 Forums > Shows > HAK5

Reply
 
Thread Tools Search this Thread Display Modes

  #1  
Old 11-07-2009, 03:04 PM
favorites
Newbie
 
Join Date: Oct 2008
Posts: 19
Status: Offline
Default New good practice / programming / list_methods()

I am forging a new good practice in Object Oriented programming.
You have a method , declared just after the constructor that will return all other methods available there listed.
Please always consider this good practice to help you manage your code and trace the methods available for your objects.


" Saying Youtube is not enough"
Reply With Quote
  #2  
Old 11-07-2009, 04:18 PM
tokenuser
Cranky Old Mod
 
Join Date: Jul 2005
Location: Lost in States
Posts: 12,057
Status: Offline
Default

Objective C already has that type of functionality, but I found that even better is making sure that you can generate a JavaDocs type class/method hierarchy directly from the code. It requires that you are a little more anal about how you do comments for class and methods, but basically creates self documenting classes.
__________________
A man's house is his castle - James Otis (and mine is for sale ... want to buy it?)
“Simplicity is the ultimate sophistication.” - Leonardo da Vinci
"I am a firm believer in the people. If given the truth they can be depended upon to meet any national crisis. The great point is to bring them the real facts...and beer." - Abraham Lincoln
"... connect the dots instead of assembling a jigsaw puzzle." - Wil Wheaton
Reply With Quote
  #3  
Old 11-11-2009, 03:55 PM
ghelyar
Member
 
Join Date: Jun 2009
Posts: 143
Status: Online
Default

This seems completely pointless to me.


In C, header files list this kind of thing anyway.

In higher level languages, there is always something to generate documentation, which will list this. Java has it (javadoc), Python has it (dir/help), all .net languages have it, etc. These are all essentially in comments so that they don't get in the way.

On top of that, most IDEs will have a way to jump to specific functions/methods and that will be essentially a list of them.



Documentation should not get in the way of functionality. Imagine how messed up your UML is going to get if you have to add list_methods all over the place needlessly. Come to think of it, a list of methods should be in your UML anyway. There's a best practice for you.

Except in extenuating circumstances, such as being specifically asked to use some obscure language, if you need to do this then you're doing something wrong.

Last edited by ghelyar : 11-11-2009 at 04:11 PM.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 09:41 PM.

Rev3 Forum RSS


(c) 2005-2009 Revision3 Corporation