Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
the title of this writeup reminded me of this recent IOCCC winning entry

*g*

I've hacked a working prototype module for internal discussion. The header file has about 300 lines of Doxygen documentation and about 30 lines of code, mainly function prototypes and macros. The source file has about 40 lines of code, plus a little bit of doxygen documentation.

Compared with our other modules, the relation between documentation and code in the source file is normal, may be a little bit short, but the documentation of the header is unusually verbose. Typically, the doxygen lines are twice or three times the number of code lines.

The prototype is still a little bit rough, it still needs some paranoia checks and some cleanly documented ways for advanced use of the mechanism. That will increase the code size by about 20 lines and the documentation by about 100 lines.

So yes, some parts of the code may look like coming from the IOCCC, but it's only the code. The documentation explains what happens, why and how, as usual for our projects.


In fact, I actually use code from an IOCCC winner at work:

IOCCC winner 1984

int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\ o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}

It's in a presentation for interns and freshly hired people, on one of the first pages, right after a picture of the HGTTG with the "don't panic" in big friendly letters. That piece of code is a really good example of bad code, on many levels. What follows is an introduction to the way we write code and documentation, why and how we do it, which modules are a little bit special, common errors, trouble with legacy code, and how to debug.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^2: [OT] Abusing GNU compiler and linker: Make the linker generate an array of function pointers by afoken
in thread [OT] Abusing GNU compiler and linker: Make the linker generate an array of function pointers by afoken

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 having an uproarious good time at the Monastery: (6)
As of 2024-04-19 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found