473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

OO re-factoring (was Pythonese/Efficiency/Generalese critique [onTutor])

In my original post I noted my recent exposure to Python and put up a
little utility to my iDisk asking for a Pythonese/Efficiency/
Generalese critique.

Javier, Kent and Liam were gracious enough to offer comments, which
were greatly appreciated. To follow through with the learning
exercise, I incorporated their comments (at least the ones there were
no conflicting opinions on :~) and put up the new version as:
http://homepage.mac.com/lee_cullens/DirTreeToCSV.zip

I was thinking of extending the learning exercise by re-factoring it
as an OO approach, since it would contain a minimum altered method.
Being new to OOP also though, I'm confusing myself with how that
would be best accomplished. My thinking is that class/subclass
method instances would replace the recursive functions approach, but
have as yet not formed the coding in my mind.

I've read a lot on OOP, but seem to have a problem with the practical
use of such in this utility. I'm undoubtedly creating a mountain of
an ant hill in my mind, so any thoughts would be appreciated.

Thanks,
Lee C


Jul 19 '05 #1
2 1289
On Wed, 8 Jun 2005 00:52:06 -0400,
Lee Cullens <le*********@mac.com> wrote:
... My thinking is that class/subclass method instances would replace
the recursive functions approach, but have as yet not formed the
coding in my mind.


I don't remember the original post, but methods and recursion are *not*
mutually exclusive (e.g., an Integer class with a factorial method, or a
binary tree class whose nodes are also binary trees).

Regards,
Dan

--
Dan Sommers
<http://www.tombstonezero.net/dan/>
Jul 19 '05 #2
Dan Sommers wrote:
I don't remember the original post, but methods and recursion are *not*
mutually exclusive (e.g., an Integer class with a factorial method, or a
binary tree class whose nodes are also binary trees).


Also, don't think that you have to make everything OO.
OO isn't necessarily better than non-OO. It's a means
to an end, not an end in itself.

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nel | last post by:
I have a question related to the "security" issues posed by Globals ON. It is good programming technique IMO to initialise variables, even if it's just $foo = 0; $bar = ""; Surely it would...
4
by: Craig Bailey | last post by:
Anyone recommend a good script editor for Mac OS X? Just finished a 4-day PHP class in front of a Windows machine, and liked the editor we used. Don't recall the name, but it gave line numbers as...
1
by: Chris | last post by:
Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm going wrong? Thanks in advance and sorry again...
11
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
1
by: John Ryan | last post by:
What PHP code would I use to check if submitted sites to my directory actually exist?? I want to use something that can return the server code to me, ie HTTP 300 OK, or whatever. Can I do this with...
10
by: James | last post by:
What is the best method for creating a Web Page that uses both PHP and HTML ? <HTML> BLA BLA BLA BLA BLA
8
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an...
1
by: joost | last post by:
Hello, I'm kind of new to mySQL but more used to Sybase/PHP What is illegal about this query or can i not use combined query's in mySQL? DELETE FROM manufacturers WHERE manufacturers_id ...
2
by: sky2070 | last post by:
i have two file with jobapp.html calling jobapp_action.php <HTML> <!-- jobapp.html --> <BODY> <H1>Phop's Bicycles Job Application</H1> <P>Are you looking for an exciting career in the world of...
1
by: Clarice Almeida Hughes | last post by:
tenho um index onde tenho o link pro arq css, como sao visualizados pelo include todas as paginas aderem ao css linkado no index. so q eu preciso de alguns links com outras cores no css, o q devo...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.