Cascading Stylesheet CSS code shown in Brackets text editor IDE Coffee Theme

Score “Outstanding” in your Penmanship: a look at Code Style

More info about Coding Style Standards.

have you ever wondered what is best practice in keeping your code consistent, not only w/ yourself, but w/ others in the industry? ever wondered what’s best for a function bracket, or what to do when a closing bracket is going to have an “else” clause? This Note is logged for the purpose of providing a suggested structure for maintaining clean code formatting. The convention used here I learned from the resource cited, the Scintilla (or SciTE ) source code editor, but the same code formatting style is prevalent in most source code you might see in books or even written by other users and programmers at almost any users’ forum.

The following information has been appropriated from the official documentation at Sourceforge for the Scintilla code editor for the purpose of demonstrating learning by example.

The following excerpt comes directly from the URL i’ve listed above††


Start brackets, ‘{‘, should be located on the line of the control structure they
start and end brackets, ‘}’, should be at the indented start of a line. When there is
an else clause, this occurs on the same line as the ‘}’.
This format uses less lines than alternatives, allowing more code to be seen on screen.
Fully bracketed control
structures are preferred because this makes it more likely that modifications will
be correct and it allows Scintilla’s folder to work. No braces on returned
expressions as return is a keyword, not a function call.

bool fn(int a) {
        if (a) {

        } else {
        return !a;



Spaces on both sides of ‘=’ and comparison operators and no attempt to line up ‘=’.
No space before or after ‘(‘, when used in calls, but a space after every ‘,’.
No spaces between tokens in short expressions but may be present in
longer expressions. Space before ‘{‘. No space before ‘;’.
No space after ‘*’ when used to mean pointer and no space after ‘[‘ or ‘]’.
One space between keywords and ‘(‘.

void StoreConditionally(int c, const char *s) {

        if (c && (baseSegment == trustSegment[“html”])) {
                baseSegment = s+1;

                Store(s, baseSegment, “html”);


Identifiers use mixed case and no underscores.
Class, function and method names start with an uppercase letter and use
further upper case letters to distinguish words. Variables start with a lower
case letter and use upper case letters to distinguish words.
Loop counters and similar variables can have simple names like ‘i’.
Function calls should be differentiated from method calls with an initial ‘::’
global scope modifier.

class StorageZone {
        void Store(const char *s) {

                Media *mediaStore = ::GetBaseMedia(zoneDefault);
                for (int i=mediaStore->cursor; mediaStore[i], i++) {


Scintilla and SciTE Code Style Preferences

††If at any time the URL becomes incorrect, and it appears that I am not crediting the correct source, i hereby claim no ownership of the quoted material above, but i’ve reproduced it here so that i can use it as a quick reference for my own education. I do not endorse copying the material above, but instead i urge you to follow the URL to the original source and consider their policy on copying the material

Leave a Reply

Your email address will not be published. Required fields are marked *