Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 34125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:01:45+00:00 2026-05-10T14:01:45+00:00

Do you often see in API documentation (as in ‘javadoc of public functions’ for

  • 0

Do you often see in API documentation (as in ‘javadoc of public functions’ for example) the description of ‘value limits’ as well as the classic documentation ?

Note: I am not talking about comments within the code

By ‘value limits’, I mean:

  • does a parameter can support a null value (or an empty String, or…) ?
  • does a ‘return value’ can be null or is guaranteed to never be null (or can be ’empty’, or…) ?

Sample:

What I often see (without having access to source code) is:

/**  * Get all readers name for this current Report. <br />  * <b>Warning</b>The Report must have been published first.  * @param aReaderNameRegexp filter in order to return only reader matching the regexp  * @return array of reader names  */  String[] getReaderNames(final String aReaderNameRegexp); 

What I like to see would be:

/**  * Get all readers name for this current Report. <br />  * <b>Warning</b>The Report must have been published first.  * @param aReaderNameRegexp filter in order to return only reader matching the regexp   * (can be null or empty)  * @return array of reader names   * (null if Report has not yet been published,   *  empty array if no reader match criteria,   *  reader names array matching regexp, or all readers if regexp is null or empty)  */  String[] getReaderNames(final String aReaderNameRegexp); 

My point is:

When I use a library with a getReaderNames() function in it, I often do not even need to read the API documentation to guess what it does. But I need to be sure how to use it.

My only concern when I want to use this function is: what should I expect in term of parameters and return values ? That is all I need to know to safely setup my parameters and safely test the return value, yet I almost never see that kind of information in API documentation…

Edit:

This can influence the usage or not for checked or unchecked exceptions.

What do you think ? value limits and API, do they belong together or not ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T14:01:46+00:00Added an answer on May 10, 2026 at 2:01 pm

    I think they can belong together but don’t necessarily have to belong together. In your scenario, it seems like it makes sense that the limits are documented in such a way that they appear in the generated API documentation and intellisense (if the language/IDE support it).

    I think it does depend on the language as well. For example, Ada has a native data type that is a ‘restricted integer’, where you define an integer variable and explicitly indicate that it will only (and always) be within a certain numeric range. In that case, the datatype itself indicates the restriction. It should still be visible and discoverable through the API documentation and intellisense, but wouldn’t be something that a developer has to specify in the comments.

    However, languages like Java and C# don’t have this type of restricted integer, so the developer would have to specify it in the comments if it were information that should become part of the public documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer What you should do is in your controller check to… May 11, 2026 at 3:19 pm
  • added an answer I like the subcommand pattern, which I'm most familiar with… May 11, 2026 at 3:19 pm
  • added an answer If you are just using command line to figure it… May 11, 2026 at 3:19 pm

Related Questions

Do you often see in API documentation (as in 'javadoc of public functions' for
This question is more or less programming language agnostic. However as I'm mostly into
How can I bind arguments to a Python function so that I can call
I have this strange issue with my web app. You see, I'm using jQuery
C++/CLI helpfully generates the IDisposable scaffolding for you when you implement a destructor on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.