Conversation
fixing typo
fixing typo
…d some more fixes
…onventions. and some more fixes
stand the example to the new conventions electronstudio#88
…ome more changes to other files
61ee4cf to
3b01e59
Compare
| screenWidth = 800 | ||
| screenHeight = 450 | ||
|
|
||
| init_window(screenWidth, screenHeight, "raylib [core] example - 2d camera") |
| Some other conventions to follow: | ||
| - **ALWAYS** initialize all defined variables. | ||
| - **use TABS / 4 spaces**. | ||
| - Avoid trailing spaces, please, avoid them | ||
| - Avoid using **semicolon** as you can |
There was a problem hiding this comment.
There are linters and formatters for that. ruff, black and isort will be enough to not bothering with those rules.
| - **use TABS / 4 spaces**. | ||
| - Avoid trailing spaces, please, avoid them | ||
| - Avoid using **semicolon** as you can | ||
| - Control flow statements always are followed **by a space**: |
There was a problem hiding this comment.
This is strange one, never saw that rule neither on production nor in open source projects. Why?
PEP8 says something like "don't write if-statements in one line"
| - Avoid using **semicolon** as you can | ||
| - Control flow statements always are followed **by a space**: | ||
| ```python | ||
| if condition : value = 0 |
There was a problem hiding this comment.
You have if-expressions for that.
value = 0 if condition else valueOr if it is initialization thing:
value = value or 0There was a problem hiding this comment.
That isn't an "if statement" that is the ternary operator
|
|
||
| for i in range(NUM_VALUES): print(i) | ||
| ``` | ||
| - All conditions checks are **always between parenthesis** but not boolean values: |
There was a problem hiding this comment.
Okay that's big whaat.
- Why always?
- Why booleans are different?
50 and True will return 50. Should it be between parenthesis?
There was a problem hiding this comment.
Well, as you see the conventions haven't really been reviewed by electrostudio so yeah they aren't perfect, feel free to fork my doing and implementing your conventions
p.s. and yeah the conventions aren't perfect because in the beginning they were made to mimic the raylib code style conventions but maybe following PEP 8 would be better...
568da0c to
22af403
Compare
hi @electronstudio.
sorry for not pushing the conventions branch. I just forgot to work on it...
currently, I didn't refactor all the examples, but as I can see it, I will probably not work on them anymore. I don't have as much free time as I had in past...