Organizing Python Code
Garth Dighton
gdighton at geocities.com
Fri Oct 6 16:16:58 EDT 2000
rwallace at esatclear.ie (Russell Wallace) wrote in
<39DD2319.6ECE412E at esatclear.ie>:
>Greg Ewing wrote:
>> Recently I had occasion to work on a Borland Pascal
>> program written by someone else, consisting of a few
>> dozen source files spread over several directories.
>> I found myself wishing that Borland Pascal had a more
>> explicit import mechanism than just "uses modulename".
>
>...I don't understand where the difficulty is?
>
>Pascal: grep "procedure foo" or "function foo" *.pas (unless my Pascal
>is rustier than I think it is :))
>C: grep foo *.h
>Python: grep "def foo" *.py
>
>and equivalents for definitions of classes, global variables etc. I
>find this easily works even for hundreds of source files of other
>people's code that I'm not familiar with.
>
This doesn't work when the code is in several directories. I frequently
have this problem at work, where the source code for our main product is
spread across several hundred files in 50 or so directories (our product is
a database server, so the architecture is fairly complicated). You CAN'T
just do a grep to find the function definition. (although you can usually
grep the include directory to find the declaration, this doesn't always
tell you where to look for the definition itself.)
--
Garth Dighton
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
More information about the Python-list
mailing list