Backend Handbook
Leapwise
  • 👋Introduction
  • Software Design Principles & Clean Code
    • Atomicity
    • Modularity
    • Hierarchy
    • Loose coupling
    • Asynchronous programming
  • Development Practices
    • JavaDocs
    • Technical Debt
    • Testing Guidelines
      • The Importance of Test Automation
      • The Testing Pyramid
        • Unit Tests
        • Integration Tests
        • End-to-End Tests
      • Mutation Testing
      • Contract Tests
        • REST Controller Contract testing
        • OpenAPI Contract testing
      • Testing Frameworks
        • JUnit 5
        • Testcontainers
        • Mockito
      • Writing Clean Tests - Best Practices
    • Common library
    • Generic CRUD
    • Update Facade
  • Development Tools & Environment
    • Monitoring
    • Performance tuning
    • Multi-tenancy & Configuration Management
    • Git practices
    • CI/CD
    • Maven
  • Project Management
    • Jira
    • Confluence documentation
    • SCRUM
    • Our ways of working
  • LIFE AT LEAPWISE
    • Introduction
    • Who are we?
    • What do we do?
    • Our values
    • Hiring process
      • Hiring: A Mid Frontend Developer's Point of View
    • Benefits we offer
    • Onboarding process
      • Onboarding: A Senior Digital Marketing Specialist's perspective
    • Mentorship program
    • Career development
      • Trainings & certificates we offer
      • Career development: A Senior Software Developer's Insight
    • Community building
    • Juniorship
    • First-hand info from our first team member
    • Join our team
Powered by GitBook
LogoLogo

Company

  • About
  • Culture
  • Services

Insights

  • Leapwise Newsletter
  • Blog

© Leapwise

On this page

Was this helpful?

  1. Development Practices

JavaDocs

PreviousAsynchronous programmingNextTechnical Debt

Last updated 12 months ago

Was this helpful?

When writing good software, it’s essential to write good documentation as well. For that reason, there should be a collection of guidelines and best practices agreed upon on the company level for writing good and concise code documentation based upon reliable sources. In short, JavaDoc is a document generator tool in Java programming language for generating documentation in HTML format. Every JavaDoc comment must include the following:

/**
Comment
/*

All of the comments are removed at compile time so it doesn’t affect the performance of the execution.

Good practices

JavaDoc should be defined at the company or team level to ensure consistency and coherence in documentation practices. Here are some of the good practices:

Use standard JavDoc tags

Include standard block and inline tags like: @param, @return, @throws, @see, @since , {@link} and@deprecated to describe parameters, return values, exceptions, and deprecated methods respectively.

Be descriptive, clear and concise

Write clear and concise descriptions for methods, classes, fields, and parameters. Explain what they do and their significance.

Adhere to naming conventions

By using meaningful names for methods, classes, and variables, ensuring that their purpose is clear from the name itself, we can avoid writing redundant comments that clutter the code.

Use HTML markup sparingly

Use HTML markup (such as <code>, <ul>, <li>, etc.) when necessary to format text for better readability. But keep it minimal and use it only when needed.

Include example usage

Add code snippets or examples to demonstrate how to use a method or class.

Update JavaDocs regularly

As you change code, update the JavaDocs regularly. Outdated comments can lead to confusion.

Document edge cases and specifics

Mention any edge cases, restrictions, or constraints that might affect the behaviour of the method or class.

Document thread safety and performance

Describe if methods or classes are thread-safe and mention any performance considerations or complexities.

Use inline comments when necessary

For complex logic or sections that might not be clear from the JavaDoc alone, use inline comments within the code to provide additional context.

Review and maintain consistency

Consistency in style, formatting, and level of detail across the codebase is crucial for better readability and understanding. Conduct regular reviews to ensure adherence to Javadoc standards.

Page cover image