linutil icon indicating copy to clipboard operation
linutil copied to clipboard

Rust code is really unreadable for beginners who want to add new functionality.

Open guruswarupa opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe.

I was trying to add a new feature into rust but then the code seems very poor in commenting what it does except few lines.

Describe the solution you'd like

Proper documenting and Commenting required to promote more growth in the Script.

Additional context

image

guruswarupa avatar Sep 20 '24 12:09 guruswarupa

@lj3954 @adamperkowski I think you two could best implement detailed comments in the rust codebase.

ghost avatar Sep 22 '24 01:09 ghost

There's 1843 total lines written in Rust in Linutil as of 006326afa9a6f98f00d1672280e38ceecb139847. 1605 in tui and 238 in core. A lot to comment.

adamperkowski avatar Sep 22 '24 12:09 adamperkowski

/unlabel 'enhancement' /label 'rust'

adamperkowski avatar Sep 22 '24 17:09 adamperkowski

There's 1843 total lines written in Rust in Linutil as of 006326afa9a6f98f00d1672280e38ceecb139847. 1605 in tui and 238 in core. A lot to comment.

Not to mention that those lines are extremely volatile. It's understandable that someone would want an easy experience with contributing, but there are times when the only way to really understand the code is to actually read the code.

Comments get old, people get lazy, and all of a sudden the once helpful comments are just bloat.

Just speaking from my own experience, this codebase is actually pretty good. There's a lot of meaningful semantic variable naming, there's not a whole lot of macros, and the code itself follows a pretty linear path. I've actually had a very pleasant experience contributing to this project for these reasons.

If you're interested there's a pretty great video by CodeAesthetic that pretty much sums up my own opinion about commenting.

cartercanedy avatar Sep 22 '24 19:09 cartercanedy

Also, I'm not saying that the internal interfaces shouldn't be documented, but I'm not sure that's what your point is, @guruswarupa

cartercanedy avatar Sep 22 '24 19:09 cartercanedy

This is actually one of the few open source codebases where I don't get lost. You can easily follow the flow and get to wherever you want to.

I do understand about newcomers tho, and maybe the more stable parts of the tool could be better documented. I can work on that if we agree that it should be worked on.

afonsofrancof avatar Sep 23 '24 04:09 afonsofrancof

/close not planned

Adding comments will clutter the codebase and updating those comments will be a hassle, especially with the rate Linutil has been going, things change, things change fast and we can't constantly be managing and updating comments in the src.

ghost avatar Sep 23 '24 13:09 ghost