Skip to content

Commit

Permalink
Add declaration before code to guidelines
Browse files Browse the repository at this point in the history
Declarations before code has been informally supported and we have
several examples in the code. This commit adds that guideline to the
coding guidelines.
  • Loading branch information
mkindahl committed Mar 17, 2021
1 parent ed62df7 commit 80f72dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/StyleGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ elaborates on the situation. Instead, we've tried our best to develop
a consistent style that roughly follows the style of the PostgreSQL
source code.

### Declarations before code

C99 supports having code before a declaration, similar to C++, and we
also support this in the code. For instance, the following code
follows the guidelines:

```C
void some_function()
{
prepare();
int result = fetch();
...
}
```

### Function and variable names

For clarity and consistency, we've chosen to go with lowercase
Expand Down

0 comments on commit 80f72dd

Please sign in to comment.