feat(Rust): added comments, still need to refine to a final state
This commit is contained in:
parent
069794dc86
commit
3efe8d534a
@ -99,11 +99,10 @@ def example_funct(input_var:type):
|
||||
- Name_of_var `type` - Additional details of what is required
|
||||
|
||||
`AUTHOR(S)`:
|
||||
- Your Name
|
||||
- Your Name <<semiperminant@exmaplemail.com>
|
||||
- Another Example <different@examplemail.com>
|
||||
|
||||
`Contact`:
|
||||
- semi-permanent email, do not need to respond but try to be a good alumni
|
||||
- Example of two items
|
||||
semi-permanent email, do not need to respond but try to be a good alumni
|
||||
"""
|
||||
|
||||
# example variable can be anything not just an int
|
||||
@ -114,12 +113,76 @@ def example_funct(input_var:type):
|
||||
|
||||
### Rust
|
||||
|
||||
Not happy with this
|
||||
|
||||
Rust is a very unique language and a great guiding book.
|
||||
You can learn more [here](https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html) about Rust's Documentation for publishing packages.
|
||||
|
||||
The goal of this is to passively train you how to produce comments and code worthy of being open source and industry level.
|
||||
|
||||
Due to the language's interesting module seperating when creating a large program. All members will be involved in the creation of all functions and how they should be seperated into their groups of related ideas.
|
||||
|
||||
First off the file tree structure will look like this example
|
||||
```
|
||||
src/
|
||||
├── lib.rs
|
||||
├── front_of_house.rs
|
||||
└── front_of_house/
|
||||
├── a_different_mod.rs
|
||||
└── other_module_linked_in_modrs.rs
|
||||
```
|
||||
These are all related functions in front of house, for small modules do not make a sub directory only large or major functions should be seperated
|
||||
|
||||
Where *`front_of_house.rs`* is like this
|
||||
```rust
|
||||
fn exampleFunc () {
|
||||
// I have not decided yet
|
||||
//! Describes what front_of_house module provides
|
||||
//! All functionality in other files this serves as a connector
|
||||
//! Main idea and a run should be in this file
|
||||
//! re exports go here as well
|
||||
pub mod a_different_mod;
|
||||
// only split if a different losely related idea is needed (the sub idea more relates to itself than to the parent)
|
||||
pub mod other_module_linked_in_modrs;
|
||||
```
|
||||
|
||||
Also where *`other_module_linked_in_modrs.rs`* looks like this
|
||||
```rust
|
||||
/// What the function does
|
||||
///
|
||||
/// ### Params
|
||||
///
|
||||
/// - input_var - Description of what the input should be.
|
||||
/// - b - Description of the second input parameter.
|
||||
///
|
||||
/// ### Returns
|
||||
///
|
||||
/// - Description of the return value.
|
||||
///
|
||||
/// ### Example Usage
|
||||
///
|
||||
/// ```rust
|
||||
/// // how a user would use this function, replace ex_crate with actual path to use function
|
||||
/// // this is how a public but internal module would be used by an outside user (ex_crate needs to be changed)
|
||||
/// let result = crate::front_of_house::other_module_linked_in_modrs::example_funct(5, 10);
|
||||
/// assert_eq!(result, 15);
|
||||
/// ```
|
||||
/// ### Author (s)
|
||||
///
|
||||
/// - Name <semiperminant@exmaplemail.com>
|
||||
/// - Another Example <different@examplemail.com>
|
||||
/// semi-permanent email, do not need to respond but try to be a good alumni
|
||||
pub fn example_funct(input_var: i32, b: i32) -> i32 {
|
||||
// example variable can be anything not just an integer
|
||||
let var_example = 0;
|
||||
|
||||
// example function does nothing significant
|
||||
var_example + input_var + b
|
||||
}
|
||||
```
|
||||
|
||||
One all of the main modules have been decided upon a senior member or lead will be assigned to that module will then be responsible and will break the module into sub components to assign out to implement.
|
||||
|
||||
The team will then come other for a final time to ensure that all sub modules make sense and thier ideas make sense and are appropriately assigned out.
|
||||
|
||||
### C++
|
||||
|
||||
```cpp
|
||||
@ -133,11 +196,10 @@ PROMISES:
|
||||
- nameOfVar `type` - Additional Details (if applicable)
|
||||
|
||||
AUTHOR(S):
|
||||
- Your Name
|
||||
- Your Name <<semiperminant@exmaplemail.com>
|
||||
- Another Example <different@examplemail.com>
|
||||
|
||||
CONTACT:
|
||||
- semi-permanent email, do not need to respond but try to be a good alumni
|
||||
- Example of two items
|
||||
semi-permanent email, do not need to respond but try to be a good alumni
|
||||
*/
|
||||
int exampleFunct (int inputVar) {
|
||||
// comments annotate the line below them
|
||||
@ -162,11 +224,10 @@ PROMISES:
|
||||
- nameOfVar `type` - Additional Details (if applicable)
|
||||
|
||||
AUTHOR(S):
|
||||
- Your Name
|
||||
- Your Name <<semiperminant@exmaplemail.com>
|
||||
- Another Example <different@examplemail.com>
|
||||
|
||||
CONTACT:
|
||||
- semi-permanent email, do not need to respond but try to be a good alumni
|
||||
- Example of two items
|
||||
semi-permanent email, do not need to respond but try to be a good alumni
|
||||
*/
|
||||
int exampleFunct (int inputVar) {
|
||||
// comments annotate the line below them
|
||||
|
Loading…
x
Reference in New Issue
Block a user