-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move the docstrings #34
Conversation
Maybe more controversial, but I'd also like to move code around in the main file. I think it would much easier to read if it was ordered:
(Not yet pushed.) |
Good idea. Maybe just put them in a |
Ok, pushed. This will trash git blame, but so be it. Now that I understand it, the 50-line core is actually quite pretty. Maybe I was confused by how much of the auxiliary stuff it was necessary to understand, and by trying to puzzle out docstrings & names for things, not what they do. |
I still stand by #32 (comment), namely that the prettiness comes at a pretty significant cost. That said, this is a genuine QoL improvement for working on the code, as it saves having to jump around too much. |
Good to go? Putting these in the main file isn't a pattern I've seen, and maybe we will hate it later. But Optimisers.jl does this and it doesn't seem awful. If you don't know the package, then you have to open the file to find out that it has nothing but two includes; and this way, you now also know where the docstrings are. This seems neater to me than needing another top-level file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another model I've seen is having the docstrings in external markdown files and attaching them. ConstructionBase does this: https://github.com/JuliaObjects/ConstructionBase.jl/blob/master/src/ConstructionBase.jl#L8
The docstrings are much longer than the actual code. I guess I like them long since I extended many of them, but they do get in the way of finding the function body. So this moves them out to the main file, which is otherwise just 3 lines.
No functional change.