• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code conventions and javadocs

 
Roby Kappa
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

one of java code conventions says that lines shouldn't be longer than 80 chars. But for javadoc comments like this:

/**
* Exits from this dialog.
*
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/

the line with @see is longer than 80 chars, but if I wrap the line to stay in 80 chars, the comment isn't correctly shown in javadoc html file. How can I solve the problem without breaking code conventions?
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If you import the classes, you won't have to specify the whole package.package.class:



Regards,
Alex
 
Roby Kappa
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
Roman Yankin
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is obviously not a good advice, but I personally do not follow 80 chars per line convention. I understand that perhaps i'll loose some points for this but in most cases this rule is causing highly inaccurate code formatting. My own experience shows that 90 chars per line is a compromise between 80 and something-really-longer chars per line
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Roman Yankin:
This is obviously not a good advice, but I personally do not follow 80 chars per line convention. I understand that perhaps i'll loose some points for this but in most cases this rule is causing highly inaccurate code formatting. My own experience shows that 90 chars per line is a compromise between 80 and something-really-longer chars per line


Or may I suggest you finish all the coding using the format you like and then change the format (using Eclipse automatic formatting) just before submitting?

It is after all a requirement! If they do open your source code with vi on their old UNIX box, perhaps 80 characters is a better fit, who knows.. This is easy points!

Regards,
Alex
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic