Table of Contents

Coding style guide

This style guide is meant to be loosely adhered to when writing libraries for the Wonderful ecosystem.

Note that this is very much a draft - I'm trying to codify what I learned from the past few years… please remain patient.

Naming

As everyone downstream will end up using the hardware libraries' API, consistency in naming is among the most important things to pay attention to. Formatting can be fixed for free; naming changes are expensive.

Global identifiers

Regarding cases:

Regarding names:

Code style

void braces_on_the_same_line(int always) {
    if (single_line)
        no_braces_is_fine;
    
    if (multi_line) {
        braces_on_the_same_line(1);
        braces_on_the_same_line(2);
    }
}

const void __far *return_pointer(void __far *my_pointer);

Documentation

Use Doxygen-compatible formatting for all user-facing documentation comments:

Best practices

Target-specific notes

wswan

References