Skip to content
Snippets Groups Projects
Commit b38751ca authored by Emanuele Aina's avatar Emanuele Aina
Browse files

coding_conventions: Align the happy path to the left edge


Point to some nice guidelines to organize the control flow, regardless
of the programming language.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent c8e40f0d
No related branches found
No related tags found
1 merge request!176coding_conventions: Align the happy path to the left edge
Pipeline #194045 passed
......@@ -34,7 +34,8 @@ specific to other APIs are covered on their respective pages.
## Summary
* [Use the GLib coding style]( {{< ref "#code-formatting" >}} ), with vim modelines.
* [Align the happy path to the left edge]( {{< ref "#code-formatting" >}} ) and
when programming in the C language use the GLib coding style, with vim modelines.
* [Consistently namespace files]( {{< ref "#namespacing" >}} ), functions and types.
* [Always design code to be modular]( {{< ref "#modularity" >}} ), encapsulated and loosely coupled.
* Especially by keeping object member variables inside the object’s private structure.
......@@ -55,6 +56,10 @@ Using a consistent code formatting style eases maintenance of code, by meaning
contributors only have to learn one coding style for all modules, rather than
one per module.
Regardless of the programming language, a good guideline for the organization
of the control flow is
[aligning the happy path to the left edge](https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88).
The coding style in use is the popular
[GLib coding style](https://developer.gnome.org/programming-guidelines/unstable/c-coding-style.html.en),
which is a slightly modified version of the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment