Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Adding Coding Standards(Java Coding Convention?) in my project documenation

  1. #1
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Adding Coding Standards(Java Coding Convention?) in my project documenation

    i beg your pardon, if i post this in this section of forums, this is the only section i think is relevant to my concern right now

    i was asked by my professor, to add these things

    a. Coding Standards
    In general, the proponents used the following coding standards:
    • The use of indention in codes to distinguish between lines and codes and to make it more readable
    • The use of comments to know the function of each code
    • Use of descriptive variables and file names.
    • The use of global variables
    • The use of modules and forms
    the thing is, i really dont have any idea how to do that, inspite of the knowledge i have regarding with Java Coding Convention, at first i was thinking "copy all the source codes of the system" and paste it in the paper? O_O,

    its similar to this

    i absolutely know what is a "CAR", but i dont know what to do with a car?, theres so many things i can do with a "CAR", i can "drive" it, "smash" it, "destroy" it, "sell" it or even "hug" it,

    i do have a knowledge with the java coding convention, but what should i put with "adding a coding standards" in my documenation?,

    i got a piece of idea on this site Coding Standards - Symfony


    what i understand is, im going to write a fragment of code, state all the rules and "THE WAY" i wrote the codes based on Java Coding Convention. im confused, please help, i dont want to blame my lack of english, i need help.. and please take care of english idioms i always got a hard time debugging thoughts that i dont understand, my professor told me that this is important on documenation. what should i do with the thing he is requesting to me? or what should i put in my codes?

    this is what i've got in mind so far, from the sample i posted above
    package timekeepsystem;
     
    /**
     * This file is part of timeKeepSystem package.
     * 
     * @author Zabdiel
     */
    public class MyClass {
     
        private int myIntegerVariable;
        private static String creator;
     
        /**
         * Static block.
         * 
         * static variables initialization on class loading
         */
        static {
     
            creator = "Creator";
        }
     
        /**
         * Constructs a new instance of this class,
         * initialized all instance variables.
         */
        public void MyClass() {
     
            myIntegerVariable = 1;
        }
     
        /**
         * 
         * @param string who Some argument description
         */
        public void myMethod(String who) {
     
            if (who.equals("Creator")) {
     
                System.out.println(creator);
            }
            else {
     
                System.out.println("Your not the creator");
            }
        }
     
        public int getSomeNumber() {
     
            return 1;
        }
    }

    and i will state how do i "WRITE" codes based on a coding convention(Java)? is that what is needed in this part of documenation?
    Last edited by chronoz13; February 19th, 2012 at 02:37 AM.


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Adding Coding Standards(Java Coding Convention?) in my project documenation

    Quote Originally Posted by chronoz13 View Post
    i was asked by my professor, to add these things
    I don't understand your question. Nor do I understand the 'quote' from your professor. If there's an issue with communication between you two, perhaps you should ask your professor to demonstrate what it is she wants on one of your smaller source files. Make sure she either edits a file so you can use 'diff' on her version and your original, or print the file out and ask her to write her comments on the paper.

    Please avoid bad variable names like 'int theIntegerVariable', 'String someStringData', and don't write redundant comments above a constructor that say "/* This is a constructor which initialises some data members */". It's obviously a constructor and initialising data members is not unexpected behaviour for a constructor. The Java SE API docs are your best example of how to write javadoc comments - see java.lang.Integer for an example of 'as good as it gets' for a constructor comment which states what is painfully obvious

  3. #3
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: Adding Coding Standards(Java Coding Convention?) in my project documenation

    I don't understand your question
    sorry for not making things clear enough, its just quite difficult to understand what he wanted me to include on papers, but still thanks for telling me these things

    Please avoid bad variable names like 'int theIntegerVariable', 'String someStringData', and don't write redundant comments above a constructor that say "/* This is a constructor which initialises some data members */". It's obviously a constructor and initialising data members is not unexpected behaviour for a constructo

Similar Threads

  1. Java Applet Coding Help?
    By Drag01 in forum Java Applets
    Replies: 1
    Last Post: April 26th, 2012, 07:03 AM
  2. Help needed with java coding!!
    By Bentino in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 14th, 2012, 08:09 PM
  3. Replies: 1
    Last Post: June 28th, 2011, 07:34 AM
  4. Help me in java coding
    By smallmac in forum Java Theory & Questions
    Replies: 5
    Last Post: August 2nd, 2010, 09:50 AM
  5. Java coding help
    By Javalover1 in forum The Cafe
    Replies: 0
    Last Post: April 12th, 2010, 08:11 PM