João Costa @JD557@blog.joaocosta.eu Follow

Portuguese software engineer at Kevel.

My instance is running on a small server so please #nobot

Web

https://www.joaocosta.eu/

GitHub

https://github.com/JD557

Twitter

https://twitter.com/JD557

Itch.io

https://jd557.itch.io

  • Notes
  • Articles 6
  • Followers 41
  • Following 59
Adam Warski's avatar
Adam Warski
@adamwarski@softwaremill.social

#Scala documentation for fields of case classes - inline, or part of the top-level scaladoc?

I think I've been using both styles at random, but is there some "official" guidance as to which style is preferred?

Inline seems to be better when reading the source code, but top-level seems more consistent with documentation for normal classes & constructors.

  • permalink
  • 5 months ago
João Costa's avatar
João Costa
@JD557@blog.joaocosta.eu

in reply to this object

@adamwarski@softwaremill.social I wasn't aware that the inline style was a thing... I think I'll start using that. 🤯

  • permalink
  • 5 months ago
  • 1 like
  • 1 reply
Alex Nedelcu's avatar
Alex Nedelcu
@alexelcu@social.alexn.org

in reply to this object

@JD557 @adamwarski Yikes, I wasn't aware either, since when?

  • permalink
  • 5 months ago
Adam Warski's avatar
Adam Warski
@adamwarski@softwaremill.social

in reply to this object

@alexelcu @JD557 As it turns out, it's not, must have been my invention ;) Probably due to the parallel with method / value definitions (which can be "simply commented" using /** */). But it turns out my inline-style is not rendered in HTML, soI'll avoid using it from now.

  • permalink
  • 5 months ago
João Costa's avatar
João Costa
@JD557@blog.joaocosta.eu

in reply to this object

@adamwarski@softwaremill.social @alexelcu@social.alexn.org Oh, that's a shame...

  • permalink
  • interact from your instance
  • 5 months ago
Marc Karassev's avatar
Marc Karassev
@mark@mamot.fr

in reply to this object

@adamwarski inline looks way better, it removes the need for @param keyword + field name repetition, but does it produces the same scaladoc?

Also inline removes the need to ensure consistency between @param annotations and actual field declarations, even if this can be automated by tooling.

  • permalink
  • 5 months ago
Adam Warski's avatar
Adam Warski
@adamwarski@softwaremill.social

in reply to this object

@mark Ah good point! :D I somehow assumed that both render the same.

But they do not: only the @param version shows the docs in the HTML version of the scaladoc. This settles this then. Thanks :)

  • permalink
  • 5 months ago
Powered by microblog.pub 2.0.0+dev (source code) and the ActivityPub protocol. Admin.