Conventions and Guidelines

Version Date Notes By
0.1 2016-10-27 Initial release JFM
TODO:
 - Aurelia coding guidelines
 - Comment guidelines

The intent of this guide is to provide the programmer with the conventions adopted by WeMake when writing code for the SGIV10. The ideia is to provide a set os rules so that everyone on the team writes code using the same style.

This helps not only in the compreension of the code, but also improves on the readability and organization of the code, making it easier for everyone on the team to maintain and work with code created by others.

Database

Naming Conventions

Table Names

  • Must be in english
  • Must have a prefix identifiying the module (t##) where ## is the module number
  • Must use snake_case
  • Must be in plural (to follow laravel conventions)
  • Must be lower case
  • Must be descriptive

Good Examples

  • t01_documents
  • t01_versions
  • t03_users
  • t03_user_statuses

Bad Examples

  • documents
  • t01Versions
  • t03_user
  • t03_user_st

Fiels Names

  • Must be in english
  • Must be lower case
  • Must use snake_case
  • Must be descriptive
  • Key fields must always be name id

Good Examples

  • name
  • description
  • user_id

Bad Examples

  • Name

  • desc

  • userID

    • -

Coding

Laravel

Laravel follows PSR-2 coding standards. You can check them here: http://www.php-fig.org/psr/psr-2/

Aurelia

TODO

Comments (Draft)

Laravel

Currently it's still in draft but we are following ths PHPDoc standards, you can check them here: https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md

File Header

Every file must have a comment header with the following format:

/**
* Description of the file
* @copyright Copyright (C) WeMake - Tecnologias de Informação, Lda. - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
*
* @author   WeMake - Tecnologias de Informação, Lda. <info@wemake.pt>
* @author   Jorge Martins <jorge.martins@wemake.pt>
* @version  $Revision: 1.3 $
*/

Other usefull tags

Tag When to use Example
@see When you need to add a reference to some URL @see http://www.wemake.pt

If the file is a class:

TODO

Methods/Functions

TODO

Properties/Variables

TODO

Aurelia

TODO