1.4. Conventions

Conventions are good. If you're working in a small team they're very useful. If you're a small cog in a gigantic mechanism of mashing wheels they're essential.

Naming Stuff

Buan uses the following naming conventions throughout:

  • lowerCamelCaps

    rule: Each word, except the first, in a name must begin with a capital letter. The first word is all lowercase. All words are all joined together.
    example: "get product list" --> "getProductList"
    general application: Filenames, variables, class methods and properties, function names, Buan config namespaces and variables

  • UpperCamelCaps

    rule: Each word in a name must begin with a capital letter. All words are joined together.
    example: "product category" --> "ProductCategory"
    general application: Model names, class names, class filenames

  • lower-hyphenated

    rule: Each word in the name is lowercased. All words are joined together with a single hyphen character.
    example: "view invoices" --> "view-invoices"
    general application: Urls, CSS classes, XML node identifiers

  • UPPER-HYPHENATED

    rule: Each word is uppercased. All words are joined together with a single hyphen character.
    example: "read me" --> "READ-ME"
    general application: None so far

  • lower_underscored

    rule: Each word is lowercased. All words are joined together with a single underscore character.
    example: "order item" --> "order_item"
    general application: Database table and field names

  • UPPER_UNDERSCORED

    rule: Each word is uppercased. All words are joined together with a single underscore character.
    example: "keyword type" --> "KEYWORD_TYPE"
    general application: Class and global constants