Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By Tolls

Thread: Keeping a neat and easy to read code

  1. #1
    Mapisto is offline Senior Member
    Join Date
    Dec 2011
    Posts
    102
    Rep Power
    0

    Default Keeping a neat and easy to read code

    When I'm writing a program, especially a long one, it always happens that it gets really unorganized and difficult to read.

    I know that in companies, they make you write in a common way so all the other programmers will be able to easily read your code.

    So before I start working in a company and learning there, I'd appreciate it if you could give me some tips of how to write a neat and readble code (or refer me to a good guide).

    Thanks!

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,178
    Rep Power
    20

    Default Re: Keeping a neat and easy to read code

    Java coding conventions.

    Not all of these are used everywhere, but this will give you the basics.

    The other thing is to keep things short.
    Short methods that do one thing (even if that one thing is call other short methods).
    Classes should not becomes monsters.
    Mapisto likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Mapisto is offline Senior Member
    Join Date
    Dec 2011
    Posts
    102
    Rep Power
    0

    Default Re: Keeping a neat and easy to read code

    Thanks!

    Any more tips would be much appreciated!

    About the monsterous classes, what would you call monsterous ?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,178
    Rep Power
    20

    Default Re: Keeping a neat and easy to read code

    More than a few hundred.
    If you're hitting a thousand (depending on comment density) then it's time to take a good look at the class.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Java code (easy to decompile?)
    By vociferor in forum New To Java
    Replies: 14
    Last Post: 06-20-2011, 07:20 PM
  2. Replies: 3
    Last Post: 04-19-2011, 12:33 AM
  3. Writing easy to follow code...
    By N00Bie in forum New To Java
    Replies: 11
    Last Post: 02-21-2011, 11:40 PM
  4. How to read excel sheet using select statments r else any easy way
    By sasi.tati in forum JavaServer Pages (JSP) and JSTL
    Replies: 4
    Last Post: 09-24-2010, 02:06 PM
  5. What's an easy way to test this code?
    By twiggy62 in forum New To Java
    Replies: 2
    Last Post: 02-10-2010, 10:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •