Wednesday 8 February 2012

Automatically generate function header comments in netbeans


Oh Netbeens how we love you, today's tip comes from a question asked in IRC that was.

" Excuse me my good sir but is there a way to generate the phpdoc function headers? I'm using Netbeens 7"

Well yes little Tim there is, this code complete tool works in all the supported languages Java, PHP, C++,C ,and  of course plenty of others, it's so so ridiculously simple to use.


Lets use this simple code snipit for an example:

     public String getDOB(String[] args){

        return DOB;

    }


There you go I told you that was simple (the code will do absolutely smeg all by the way) go ahead and place the code in the a Netbeens code window, now just above the functions type "/**" that's one forward slash and two asterix, now are you ready ? yes ? sure ? good then press enter.
/**
 * 
 * @param args
 * @return 
 */
    public String getDOB(String[] args){

        return DOB;

    }

Shazam did you see that it generated the comment header for you with the  @param and @return, well isn't that nice! Well now you have no excuse but not to use it, that is unless you are like me and don't do it dew to shear bone idleness.

No comments:

Post a Comment