Skip to content
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

Style and Conventions #1

Open
c0gent opened this issue May 10, 2015 · 2 comments
Open

Style and Conventions #1

c0gent opened this issue May 10, 2015 · 2 comments
Assignees

Comments

@c0gent
Copy link
Member

c0gent commented May 10, 2015

Expound on code style and library related conventions.

@c0gent
Copy link
Member Author

c0gent commented Jun 12, 2015

CONVENTIONS


idx: current index (of a loop, workgroup, queue, etc.)
- almost always a physical in-memory address

idz := index[0], first element, starting element

idz_parent: first element within the subset of a parent group
- ex.: syn_idx := syn_idz_den + syn_id_den

idn := index[len]: element after final element, termination point
- ex.: for(int i = 0, i < idn, i++)

idm := index[max] := index[len - 1]: final (valid) element just before idn. idn - 1 = idm.
- ex.: for(int i = 0, i <= idm, i++)

id: identifier, but not a physical array index

id_parent: identifier within the subset of a parent group
- ex.: syn_idx := syn_idz_den + syn_id_den

***** High Priority Comment, Temporary Code Change
<<<<< Medium Priority Comment, To Do
##### Debug Message Prefix

@c0gent c0gent self-assigned this Jun 12, 2015
@c0gent
Copy link
Member Author

c0gent commented Jun 19, 2015

Elaborate on fully expanded function definition style.
ex:

pub fn my_function(
    &mut self, 
    important_param: u8,
    awesome_thing: AwesomeThing,
    //old_thing: Vec<OldStuff>,
    optional_thing: Option<usize>,
) -> ReturnedThing {
    ...
}

All lines are easily comment-out-able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant