• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Code conventions and javadocs

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic