Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Coding conventions #3

Closed
Drakulix opened this issue May 10, 2017 · 6 comments
Closed

Coding conventions #3

Drakulix opened this issue May 10, 2017 · 6 comments
Labels

Comments

@Drakulix
Copy link
Owner

Agree on coding conventions.

Tabs: 4 Spaces
Format: UTF-8
Line breaks: Unix Style

Recommendations:

  • Python: docstrings, pep8 with increased line limit 100
  • Javascript/JSX: no idea
@Drakulix
Copy link
Owner Author

@Rintel Are there common conventions for Javascript/JSX that you would like to see added to this?

This would be relevant for @Leats, who could probably use this information for #7.

@Leats
Copy link
Collaborator

Leats commented May 15, 2017

What about for JavaScript the airbnb Style Guide? They also have a React/JSX Style Guide
But then again I'm not in the frontend group, so I don't think I should be the one to decide that.

@gitmirgut
Copy link
Collaborator

For the python docstrings, I recommend Google Style Python Docstrings , which becomes handy in combination with Sphinx-Napoleon to auto-generate parts of a doc.

@Drakulix
Copy link
Owner Author

@Leats Research on doc string till sunday.

@Leats
Copy link
Collaborator

Leats commented May 17, 2017

I researched both the PEP 257 Docstring conventions and the Google Style Python Docstrings, which @gitmirgut suggested.



PEP 257 - Docstring Conventions:

Nicely structured, gives more in-depth information about how to write the docstrings (e.g. write „Do this.“ instead of „Does this.“, ….)

Google Style Python Docstrings:


Has more information about the overall structure of the docstrings, e.g. how one should write about the Args, Returns, Raises. While PEP mentions those it does not give conventions about the structure of them.

Also, as gitmirgut mentioned, if we use Sphinx with Napoleon it seems like we can let some parts of the documentation get auto-generated. The tutorial on this does seem to be straightforward enough.
However, I have never worked with Sphinx before/ I’m not sure if we already talked about other tools helpful for documentation/ if anyone has other ideas about that?



From what I’ve read I would also tend to use Google’s Docstring Conventions, maybe with the addition on how to write the description („Do this.“ instead of „Does this.“ or the other way around, to keep it in one style, unless you think that’s overkill)

@Drakulix
Copy link
Owner Author

Google Style > PEP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants