-
Notifications
You must be signed in to change notification settings - Fork 46
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
[Conventions] Define further conventions #120
Comments
One of the most important questions is the matter of spacing and indentation. Despite the common question of tab versus spaces, there are also possible differences regarding the framing of operators and operands by spaces, e. g.
By looking at the overall formatting of the repository, I noticed that
Are these impressions correct and according to the current conventions or should other methods be applied for future code? |
I think the indentation with 2 spaces and the framing could be part of the conventions for future code. The framing probably is mixed between the second and third variant, so I would probably prefer the second, but the third is also okay. The first one is really bad for doing find&replace. |
Okay, I am going to add these things to The next thing I would like to discuss is the general style. Here is an overview over three common styles:
I would suggest the following style, a mixture of GNU and BSD:
Style 4 has proven to be quite good readable. Furthermore, there is the question how to break very long tuples, e. g. from parameter lists. I would like to propose the Haskell-like style which forms some sort of bulleted of the parameters:
|
I would also prefer style 4 (which seems to be in line with most of the code). However, I think we could delete the semicolons in |
The newer code should be mostly BSD style 2 which would be my preferred choice. In any case, we should only reformat code that is modified. Otherwise, it would be hard to distinguish between code changes and formatting changes. |
I agree with both of you that the changes should be made first of all to newly adjusted lines of code. For the big update to version 4.0.0, I would suggest anyway that such a refactoring should be processed for all source files but this is an optional change. I am going to add the concerning information to |
What about the Haskell style of line breaking? |
|
In order to prepare an active contribution to the project, I would like to know more about the applied conventions. By doing so, I intend to keep a uniform look of the repository when contributing.
Since
CONVENTIONS
contains only information about the name mangling procedure at the moment, I would like to suggest to add further conventions thereby in this file. As an enhancement for a future version, one might also think about adjusting all source code to meet the requirements ofCONVENTIONS
such that contributing as well as overall orientation within the code becomes easier due to reliable standards.The text was updated successfully, but these errors were encountered: