#Make it mandatory to write function and logic documentation when contributing to pumpkin

1 messages · Page 1 of 1 (latest)

dusty bane
#

Since the original message kind of wasn’t placed that well in pumpkin-dev and a lot of messages were written since then, here‘s a link to the thread:

#pumpkin-dev message

dusty bane
#

Remember to vote in the original thread, you can also upvote this ^^

#

First poll link (second is below the first one):

#1351099930764120064 message

dusty bane
#

This will also help reducing the time writing documentation later on because most of the work is already done in chunks of documentation with every pr

dusty bane
#

@trim jewel I think this is almost a unanimous decision after three days. Poll results seem pretty clear. Lemme know what you think tho and obviously you have the last say ^^

When you give the go, I‘ll start writing some guidelines

remote tide
#

I think referencing source code would be better

#

Like // DoorBlock.java line: 86

dusty bane
remote tide
dusty bane
#

I also think it just takes some time to get used to writing your thoughts down while writing code. This way you already have a base of documentation that can ease the annoyance when simply fixing grammar or sentence structure

remote tide
#

imo writing documentation is easier afterhands that while doing something though

#

But I guess you could implement first then write

dusty bane
#

I like both ways sometimes, the important part is that it is present during PRs

#

Sometimes I actually prefer to write basic documentation before ever touching code when I just want to structure my logic because code gets complicated in no time

bronze pumice
#

how do you attribute the responsibility for documenting a piece of code after it's merged and done?

sleek scaffold
#

git blame

dusty bane
bronze pumice
remote tide
#

Or, just read the code lol

#

Unreadable code doesn't get accepted into master

dusty bane
# remote tide Or, just read the code lol

Yes, rust makes it particularly easy sometimes to understand stuff but at the same time documentation doesn’t hurt and actually causes less headache while figuring out what’s happening

bronze pumice
# remote tide Or, just read the code lol

Yes, code should ideally be self-documenting but in reality that's often not the case. Reading your own code is always easy. Also to grasp overall concepts documentation should exist. For example explaining the workings of a module.

dusty bane
#

@trim jewel I’m currently a bit busy with university stuff but this still seems relevant and wanted by the community. If you‘re fine with this proposal, I‘ll work on some guidelines and general recommendations for documentation when I‘m free

wild falcon
#

I know that could be a bit of a hassle at the beginning since it needs to be done for existing code too but a simple "rust" way of doing this is:

#![warn(missing_docs)]
#![warn(clippy::missing_docs_in_private_items)]
#

And knowing that a PR is not accepted if linter failed, well this could force user

#

(Homever it's a brutal way)

remote tide
#

I think a markdown file in each dir is good enough, I’m gonna do that for the inv at least

dusty bane
# remote tide I def don’t think every function needs docs

I kind of disagree. Every function has a reason to exist and should contain the documentation needed to understand it without needing to looking up additional resources (this includes self-documenting code) or even if the documentation is just one line

Moving documentation into a markdown file outside of the current function scope could confuse, slow down or even disrupt the coding experience through uncertainty, complexity and issues with direct readability

#

I‘m not saying documentation for each function should be so and so long. I‘m saying, every function needs at least a bit of care with documentation, even just a one liner is enough sometimes

remote tide
#

Markdown file gives more of a understandingh as a whole tho if you're looking at the code the first time

remote tide
dusty bane
remote tide
dusty bane
#

Code and docs should have a symbiotic relationship, each flowing naturally into the other while reading a function. That’s the ideal I‘m referring to

remote tide
#

Ye, function hover examples are great

dusty bane
remote tide
#

Ye

#

Both would be best ideally

#

But everyone hates writing docs lol

dusty bane
#

Thank you for the feedback :)

remote tide
#

np

wild falcon
dusty bane
remote tide
remote tide
wild falcon
remote tide
#

I gave up trying to use llms to write rust code, but they are good at explaining rust types

hearty rampart
#

from all llm i tested for rust Grok seems the best

wild falcon
dusty bane
wild falcon