[Pmwiki-users] Coding Style for pmwiki2

Patrick R. Michaud pmichaud
Sun Sep 19 07:44:27 CDT 2004


On Sun, Sep 19, 2004 at 11:46:02AM +0700, Pham Cong Dinh wrote:
> Hi everybody,
> 
> I could not find any documentation on coding standard for pmwiki. It 
> seems that the coding style used in pmwiki2 is not compatible with PEAR 
> Coding standard.

Nope, I didn't follow PEAR coding standards, if only because I didn't
know they existed and because they don't really fit with the way things
normally work in a wiki.  I don't have any plans to change at this point.

My coding standards are essentially as follows:

1.  Functions and global variables are capitalized like WikiWords 
    (so they can be easily detected by the FmtPageName subroutine and
    used as named targets in the wiki documentation).
2.  Variables intended to be used for pattern matching are suffixed with
    "Pattern".
3.  Variables containing $-substitutions to be handled by the FmtPageName()
    function are suffixed with "Fmt".
4.  Rules 1-3 can be violated if there's a strong enough reason to do so.


Note that I'm also beginning to document PmWiki 2 functions at
http://www.pmwiki.org/pmwiki2/pmwiki.php/PmWikiFunctions.  Feel free to
add documentation, or to add placeholder pages for functions you'd like
to see documented sooner rather than later.  :-)
    
Pm



More information about the pmwiki-users mailing list