Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GIT & Style Guide

GIT & Style Guide

Capacitación sobre GIT y buenas prácticas de código

Avatar for Luis Alonso Paulino Flores

Luis Alonso Paulino Flores

October 24, 2016
Tweet

More Decks by Luis Alonso Paulino Flores

Other Decks in Programming

Transcript

  1. Remind that we are a team :) so everything becomes

    easy. But .. it’s sounds complicated …
  2. How does it works? ❖ Master Branch ❖ Hotflix Branchs

    ❖ Releases Branchs ❖ Develop Branch ❖ Features Branchs
  3. Sounds very cool! :D A commit is a micro-atomic comment

    that identify an important point in your feature, it means, in your local repository, please, commit! commit! and commit!
  4. How should I commit? Commit : Imperative verb + description

    Example : (1) Change behavior of X vs (2) Changing behavior of X “If applied, this commit will YOUR-COMMIT” (1) If applied, this commit will CHANGE BEHAVIOR OF X. (2) If applied, this commit will CHANGING BEHAVIOR OF X.
  5. Incredible!! I love it! As you can see, we have

    many things we should improve! :)
  6. So .. now I’m working in the class Cuentas.php, so

    I’m going to create my branch called features/accounts :D REALLY?!
  7. No? :( :( :( :( Keep calm, we are going

    to define some rules in the style-guide: NO SPANGLISH
  8. About the brackets : public class ApiService { } public

    class ApiService { } Choose just one for the project. Do not mix!
  9. About the indented: public void foo() { ----int aux =

    0; } public void foo() { ----switch(a) { case 1 : case 2 : } } Tab must be configured to 4 spaces. In case of switch, the cases must be indented by 2 spaces.
  10. About the sentences: if (x == y) { } else

    { } int a = b; 1. Divide in blocks separated by blank lines. 2. One space between the sentence and the parenthesis and between the sentence and brackets. 3. The else clause must have the same constraints specified in clause 2. 4. One space at left and right on an special operator like : =, &&, &, |, | |, +=, -=, ++, --, <<, >>, <, >, ==, etc ...
  11. About the structure: • Always manage a constants file. •

    Discuss a common way to package the project. • Be sure your class names and package names are the most descriptive as possible. • And the most important : LEARN TO LOVE YOUR CODE