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

  • SEARCH
  • Home
  • 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 9143949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:09:00+00:00 2026-06-17T10:09:00+00:00

Is there a standard to interpret the syntax of function interfaces in API documentations

  • 0

Is there a standard to interpret the syntax of function interfaces in API documentations and if yes, how is it defined?

Here is an example on how to change the color of an item the JavaScript scripting guide for Photoshop for the “fillColor” function:

fillPath
([fillColor]
[, mode]
[, opacity]
[, preserveTransparency] [, feather]
[, wholePath] [, antiAlias])

What is the meaning of the brackets and why are there commas in the brackets? How does this relate to the following example calls?

myPath.fillPath(myNewColor)

myPath.fillPath(mynewColor, {
    mode: RGB,
    opacity: .5
})
  • 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. Editorial Team
    Editorial Team
    2026-06-17T10:09:02+00:00Added an answer on June 17, 2026 at 10:09 am

    So why is API documentation written in such a way as to confuse perennial newbs / hackers / DIYers like myself?

    It’s really not meant to be written that way. I’ll agree there seems to be no ease of use across API documentations. However, there is a lot of cross over from older man style syntax conventions, to the modern API/namespace conventions.

    Typically, the type of person who works with API, will have some background in development or at the least a ‘power user’. These types of users are used to such syntax conventions and it makes more sense for the API document to follow than to try to create new ones.

    Is there some mysterious document somewhere that tells people how to read API documentation?

    There really is no standard, or RFC, supersekretsyntaxdoc laying around anywhere, however there is a ~30 year old file for UNIX man page synposis format which is widespread use.

    Some examples of this (and answering your question) would be :

    Underlined words are considered literals, and are typed just as they appear.

    Square brackets ( [] ) around an argument indicate that the argument is optional.

    Ellipses … are used to show that the previous argument-prototype may be repeated.

    An argument beginning with a minus sign – is often taken to mean some sort of flag argument even if it appears in a position where a file name could appear.

    Almost all programming related documentation uses this type of syntax convention, from Python, man pages, javascript libs (Highcharts), etc.


    Breaking down your example from Adobe API

    fillPath
    ([fillColor]
    [, mode]
    [, opacity]
    [, preserveTransparency] [, feather]
    [, wholePath] [, antiAlias])
    

    We see that fillPath() (a function) takes optional arguments fillColor, mode, opacity, preserveTransparency, feathe, wholePath or antiAlias. Calling fillPath(), you could pass anywhere from none, to all, of those parameters to it. The commas within the optional [] mean that if this parameter is used in addition to others, you need the comma to seperate it. (Common sense sometimes, for sure, but sometimes some languages like VB, explicitly need those commas to properly delineate which parameter is missing!). Since you did not link to the documentation (and I can’t find it on Adobe’s scripting page) there really is not a way to know which format the Adobe API is expecting. However, there should be an explanation at the top of most documentation explaining the conventions used within.

    So, this function could probably be used many ways :

    fillPath() //Nothing passed
    fillPath(#000000,RGB) // Black, in RGB mode
    fillPath(#000000,RGB,50) // Black, in RGB mode, half opacity
    
    //Now it gets tricky, this might ALSO be acceptable:
    fillPath(#000000,50) // Black, no mode, half opacity
    
    //OR
    fillPath(#000000,,50) // Black, no mode, half opacity
    

    Again, there usually are some standards across all documentations relating to API/programming. However in each doc, there could be subtle differences. As a power user, or developer, you ARE expected to be able to read and understand the documents/frameworks/libraries you’re attempting to use.

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

Sidebar

Related Questions

Is there a standard C function similar to strtol which will take a char*
Are there any existing languages where the programmer can change the language's syntax at
Are there standard file names for Terms of Use and Privacy Policies? For some
Are there standard optimization tricks for Objective-C to make for faster execution along the
Is there any standard way of debugging Javascript on a webpage that's being accessed
Is there a standard Java library that handles common file operations such as moving/copying
Is there a standard convention for the types of files that go in \Windows\
is there a standard way to encode the user location (country, state/region, town), so
Is there a standard way of maintaining a weak pointer to a parent (which
Is there a standard or common way in C++ to handle static strings that

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.