You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use triple-slash style Doxygen comments for functions, methods, enums, structs, and unions.
423
+
```cpp
424
+
/// @brief Summary of what the following body of code does.
425
+
///
426
+
/// @param [in] parameterName0 Description of this input parameter.
427
+
/// @param [out] parameterName1 Description of this output parameter.
428
+
///
429
+
/// @returns Omit if this isn't a function/method, or it's a void one.
430
+
```
431
+
411
432
### Internal code
412
433
413
434
Internal PAL code (anything not in inc/, and private members of classes
@@ -485,6 +506,13 @@ class Platform
485
506
synchronization assumptions made by a class or function (i.e., this
486
507
function should *never* be called from multiple threads, etc.).
487
508
509
+
#### Motivation
510
+
The PAL team decided on this unique commenting style universally. We used to work on drivers that required full Doxygen comments in every file. It was a poor experience because:
511
+
512
+
- If we're going to use Doxygen, we want to do it right. That means exhaustively commenting every function parameter and every member variable. This is a huge waste of time when almost all member variables and function parameters are trivially understandable based on their name alone. Otherwise, a simple informal block comment above the variables or above the function gets the point across.
513
+
- Doxygen is meant to generate docs, and such the formatting is rather tedious and complex if you're never going to generate those docs. The only thing worth formally documenting in PAL is the interface, everything else is just "read the code" documented. Thus we're much better served with a very plain style that just gets the point across internally.
514
+
- The only good thing about Doxygen is the generated docs. We assume client driver engineers would generate Doxygen docs to help them read up on our interface headers. This is the only reason we still Doxygen for the public interface.
0 commit comments