Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Style guide #16

Closed
vmarkovtsev opened this issue Aug 25, 2017 · 4 comments
Closed

Style guide #16

vmarkovtsev opened this issue Aug 25, 2017 · 4 comments
Assignees

Comments

@vmarkovtsev
Copy link
Contributor

vmarkovtsev commented Aug 25, 2017

I propose two things here:

  1. Explicitly state the style guide because writing C/C++ without a clear style guide is a nightmare

  2. Since the only sane style guide I know is GC++SG I propose to adopt it, though it will require renaming struct names and header guards and reordering function arguments (at least).

@abeaumont
Copy link
Contributor

We are already using google style guide, we should make it explicit in the README though.
Could you point an example of the problems you have already noticed?

@vmarkovtsev
Copy link
Contributor Author

Sure.

Parameter order

node_api_find mutates find_ctx *ctx while the rest of the arguments are read-only, this should be moved to the last place.

find_ctx_set_len - length is read-only, thus the arguments should be swapped.

Naming

Structs:

node_iface -> NodeIface

node_api -> NodeApi

find_ctx -> FindCtx

Header guards

LUAST -> LIBUAST (this is the project name)

LUAST_SRC_NODE_API_H_ -> LIBUAST_SRC_UAST_H_

@abeaumont
Copy link
Contributor

Thanks!

@abeaumont
Copy link
Contributor

Solved by #22 and #23

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

No branches or pull requests

3 participants