# Argument-specific docstrings or comments

**URL:** https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189
**Category:** Internals & Design
**Created:** [December 12, 2019, 11:37am UTC](https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189 "2019-12-12T11:37:02Z")
**Posts on this page:** 4
**Page:** 2

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [December 14, 2019, 10:17pm UTC](https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189/21 "2019-12-14T22:17:44Z")

</div>

I have something similar that I use in Juno, would be good with a native atom solution though  
[https://github.com/baggepinnen/AutomaticDocstrings.jl](https://github.com/baggepinnen/AutomaticDocstrings.jl)  
I have an atom script that does almost the same thing, but my Javascript skills are nonexistent so I didn’t really get it all the way, code in this issue  
[https://github.com/JunoLab/atom-julia-client/issues/519](https://github.com/JunoLab/atom-julia-client/issues/519)

---

<div class="post-metadata">

### Author: ![Stercator](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stercator/32/210731_2.png) [@Stercator](https://discourse.julialang.org/u/Stercator)
#### Post date: [February 11, 2026, 1:29pm UTC](https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189/22 "2026-02-11T13:29:00Z")

</div>

I also hate that when I update a function, I forget to update the docstring because it’s not synced. I once tried inline docstrings like this not knowing that it wasn’t allowed, so I assume this format/syntax is the most intuitive:

```julia-auto
function some_function_name(
        "Some argument description."
        a::Int,
        "Another argument description."
        b::String = "default"
)
    # Do something
end

```

How I would expect the docstring to appear is something like in Excel or [@MartinOtter’s reply](https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189/15):

```julia-auto
f(|

```

> f( **a::Int** [, b::String])  
> Some argument description.

```julia-auto
f(1, |

```

> f(a::Int, **b::String** )  
> Another argument description.  
> Default: `"default"`

(How exactly the docstring is presented is secondary, this example is just for illustration.)

Argument docstrings should be relatively short, they are not the right place to cram in a whole manual. They’re also not meant to _replace_ other docstrings, just to _enhance_ them. With modern editor support, I don’t expect any code readability issues—on the contrary, you find the right information in the right amount at the right site.

---

<div class="post-metadata">

### Author: ![mefob](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mefob](https://discourse.julialang.org/u/mefob)
#### Post date: [February 18, 2026, 9:11am UTC](https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189/23 "2026-02-18T09:11:20Z")

</div>

Instead of a docstring-only solution, wouldn’t it be better to have a more general solution to attach arbitrary attributes (potentially more than one) to any language element?

Ideally, the mechanism would be the same for variables, functions, function arguments etc.

- Rust provides such a mechanism, [Attributes - The Rust Reference](https://doc.rust-lang.org/reference/attributes.html), with a unified syntax.
- C++11 has a similar mechanism: [Attribute specifier sequence (since C++11) - cppreference.com](https://en.cppreference.com/w/cpp/language/attributes.html)
- C# has attributes, too: [Attributes - C# language specification | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/attributes)

These attributes could then be used by an external typechecker to implement e.g. refinement types, as recently discussed here [Would it make sense for Julia to adopt refinement types?](https://discourse.julialang.org/t/would-it-make-sense-for-julia-to-adopt-refinement-types/113586).

---

<div class="post-metadata">

### Author: ![Stercator](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stercator/32/210731_2.png) [@Stercator](https://discourse.julialang.org/u/Stercator)
#### Post date: [March 2, 2026, 2:15pm UTC](https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189/24 "2026-03-02T14:15:52Z")

</div>

Or Java’s annotations.

[Previous page](https://discourse.julialang.org/t/argument-specific-docstrings-or-comments/32189.md?page=1)
