Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I actually ran into a similar need a little while ago, when I joined a project that had similar problems, only in php. Here is the program I wrote, adapted (poorly) for perl files. It's pretty apparent you'll never be able to accurately find all varibles and subs due to perl's free and easy syntax. The story follows below.

I joined this project that my friends (bad move number one) were working on. When they sat down to show me the code the familiar 'cold feeling of dread' swept over me. There were no comments.

"Oh, that's OK", said friend #1, "the code is self explanatory" (ouch).

"But you must have some comments in the code!" I exclaimed in a horrified voice.

"Oh yes, we do. Look, just before each function declaration, there's a comment" (twitch).

"And what about the variables?"

"Oh, they're self explanatory" (whimper).

I returned the next day armed with the program I linked to above, and ran it over their code. It revealed, amoung other horrors, that they were declaring the same function in different scripts (which worked together to run the website).

"Guys, why do you declare the same function in different parts of the program?"

"Well, when we were doing the new parts, we just cut and pasted the old functions, cause it was easier than worrying about making function libraries" (blackout) "but it's OK, when we change one we go through and change the rest" (suppresed scream) "How did you find out about the functions so fast?".

"Oh, I wrote this program to go through your source and pull out all the functions and variables"

"Oh excellent! Now we don't need a code map, we can just use your program!" ---

Sorry to put you all through that, I just had to get that off my chest. It's actually the abridged conversation, since he spent half an hour trying to convince me that you didn't need documentation if you used descriptive names for the functions and variables, while I got more and more 'worked up'. This rant probably gives the wrong impression too, because he is my friend and I do like him, but I could find no way to convince him that documentation might be a good idea. I eventually volunteered for webmaster and spent the next three months updating the library's closing hours.

I suppose the real joke is that that was his first job after graduating as a COMPUTER SCIENCE MAJOR.

____________________
Jeremy
I didn't believe in evil until I dated it.


In reply to What you want and perl advocacy gone way wrong by jepri
in thread module info by ivory

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-24 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found