Conversation
784d267 to
ece4d6d
Compare
ece4d6d to
610a03a
Compare
|
Following this, I believe that the sampler init functions are incorrectly named, e.g. |
|
I think these are OK since the subject is It should also cover cases such as |
|
I think it would be useful to put it in terms more familiar to programmers. For example, if we assume an object model, then the naming convention could be defined as |
|
Other things to document:
|
|
Great suggestions - will update those tomorrow. |
6edcfb7 to
e7bc61b
Compare
I've added a guideline. Needs to be extended with the |
|
My recommendation would be to use |
1429c30 to
7637216
Compare
e015794 to
10ef6c1
Compare
|
For blocks starting with |
dab577a to
1ee6230
Compare
1ee6230 to
b6f9640
Compare
|
"Documentation is a community effort. When you need to look into the source code |
|
Might be good to also add a link to the C++ Core Guidelines, generally it's very good advice: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines |
9d438a4 to
95d87cb
Compare
|
It would be good to also document file naming. For example, most headers use |
| - Vertical alignment makes things more readable and easier to batch edit | ||
| - Clean-up any trailing whitespaces, use 4 spaces for indentation, brackets on the same line, `void * ptr`, `int & a` | ||
| - Naming usually optimizes for common prefix (see https://github.com/ggerganov/ggml/pull/302#discussion_r1243240963) | ||
| - Use sized integer types in the public API |
There was a problem hiding this comment.
| - Use sized integer types in the public API | |
| - Use sized integer types such as `int32_t` in the public API, e.g. `size_t` may also be appropriate for allocation sizes or byte offsets |
| # Documentation | ||
|
|
||
| - Documentation is a community effort | ||
| - When you need to look into the source code to figure out implementation details to figure out how to use an API consider adding a short summary to the header file for future reference |
There was a problem hiding this comment.
I edited my original post and crossed out "to figure out implementation details" and replaced it with "to figure out how to use an API" since I think implementation details don't actually belong in the header. It seems both got copy-pasted; I guess this formulation also makes sense though it sounds awkward.
* contrib : add naming guidelines * contrib : expand naming guidelines [no ci] * contrib : cont [no ci] * contrib : add `_t` suffix guideline [no ci] * contrib : cont [no ci] * minor [no ci] * contrib : move coding guidelines to correct section [no ci] * contrib : minor reword coding guidelines [no ci] * contrib : add TODO for preprocessor directives [no ci] * contrib : expand [no ci] * minor [no ci] * contrib : clarify `_context` suffix usage [no ci] * contrib : filename guidelines [no ci] * contrib : fix notes [no ci]
ref #11167 (comment)