jueves, 6 de marzo de 2014

Private Repositories vr. Public Repositories

Private Repositories vr. Public Repositories

What is a repository?

A repository is a place where you post information , project data and others, is a space in the cloud ( Internet ) , which serves to keep our information safely . A repository helps us to have better control of information, so the information will always be current and can make checkpoints more often.

When you develop a project, it is good practice to put the project in a repository. This is because if for some reason the project is damaged, you can return to the last working version without problems. If the project is lost or the computer you are working is damaged , please download the latest version of it.

part 1 - Why use a public repository ?

When you want to present and publish their projects and holding, use github is very important, because this is a public github repository. Thus, you can have a personal resume with all your projects, and so show your development computer engineer. 

part 2 - Why use private repository? 

When major projects are done, you need to be securely supported and information. It is also important, because only people related to each project will have access to each repository. 

In the end, the important thing is to use a repository to have projects safely and always updated backup.

miércoles, 5 de marzo de 2014

Facebook & Development Environment

Facebook & Development Environment

Part 1 - Logging in using Facebook  

At first, I did not know how the system has many applications for facebook to login and comment can from different applications. After some research I understood that there is a deferential logging for mobile with Android, iOS and web applications.

As I began to develop with Facebook login, it was necessary to have a series of files made by Facebook, this is because you need to have certain security measures established by them. Once done, it's easy to add buttons add comments and share information on a specific topic.

One of the main rules is, the application can run in a just server, this can be local (within the same computer) or be on the internet. This means that if the application running off of a server, cannot connect to Facebook.

Part 2 - Installing the development environment of an existing project

When the project starts, we have all the tools necessary for their development. Not so with frequent, so you need to have to download programs, applications and files to run what currently exists.

When we proceeded to install tools databases MySQL and PostgreSQL as is necessary to pay attention to the usernames and passwords that are put during installation. This was because of the project demanded a username and password specific to access everything the right way.

Another point to consider is that although succeed in obtaining the same tools and the same versions, you can have problems. This will depend on the operating system you are using, for example, might not work in Windows, but a Mac to work properly.


Finally, once it manages to make everything work properly, you need an installation manual of the different environments they create. This in order to make the project maintainable into the future.

What is a "User Story"?

What is a "User Story"?


When a project is developed, you must first know exactly what you need to do the project. What is the main objective? This point, normally you should know if the project has a significant degree, but this usually does not happen, so it is necessary to have that dialogue with the customer.

You can create a relation of 1-1. Each use case project to a "user story". This is because both have a series of steps. A "user story" should have one main objective, it is performed by an actor, has a post-status and steps.

This can be very similar to an operation contract in a use case.

The steps are defined for a specific scenario, for example, at which time you can apply a "user story" specified.

A scenario is defined by a specific context, with specific characteristics. These specific features are defined by the client, based on what he wants to do when in that scenario.

Once you have the title of "user story", the user or actor, specific objective and that is what should be done. Now you have to define how to develop the specific scenarios.

To define the steps, you have keywords, which are: 'Given', 'When', 'Then', 'And' and finally 'BUT'.

The following is an example of a user story:

Feature: User management
  As a User
  I want to edit my personal information.
  So that I should be able to edit or delete my information.
  Scenario: Delete account
    Given that I want to delete my account.
    When I press the delete account.
    Then the system should ask: Are you sure?
    When you press "Yes", the account will be deleted.
    But if I press "No", the operation is cancelled.



lunes, 20 de enero de 2014

S.O.L.I.D. -> Single Responsability Principle

     The single responsibility principle says that everything must have a reason, and should only be made for a specific purpose therefore should only do an action, and the only class methods must also perform a specific action. This is done in order to delegate functions.

     Why should delegates functional? Because it's easier to understand what to do each snippet, and so is easier maintain it our code. Maybe at first, it may find it silly, but when programs are made, one can always make corrections. These corrections should not change the operation of the program and should not be complicated to add, remove or modify things.

     That is why this principle is very important as it makes things are divided and are easy to identify.

     For example, if you have two classes, A and B, if I make a change in class A, should not affect the B class, just as if change is made in B. In the event that a change is made in some of the 2 classes and affect the other, this principle is not being met.

     A common mistake can be put A and B in a single class AB, this is extremely serious, as it's class would have more than one responsibility, remember that they should only do one thing.
Imagine that we are going to make a program, which is called Pen, the first thing to do is to divide responsibilities, must have a class responsible for the ink, another class responsible for the cover, another class responsible for the pen tip and Finally, one handle of the pen body. That would have at least 4 classes like pussy, and finally an interface that the 4 classes to form a pen is made.

     Ink class, you just need the tone. The tip class need only know the thickness you want. The body class, you just need the dimensions of the pen you want to do. The cover class, just need the color you want for the pen and dimensions. The good thing is that each of these elements can change and does not have to affect others.


     How to know if this principle holds, if you can change the specification of the ink and the other classes are not affected, can be changed to add or remove items to the body and the other classes are not affected.

What’s clean code for me?

     When I had the interview on Pernix-Solotions, the boss asked if it was good programming, to which I replied: Yes sir! After that, the first book I had to read are here Pernix-Solutions was Clean Code. Now that I finished reading the book, I had a serious error the concept of good programmer.

    A good code is not enough to be functional, it must be understandable. This means that other programmers but do not know the code, you must understand what each method, each function or class structure. You should also be understandable for oneself, it may be months where you do not touch a specific code but when returning again, one must be in the ability to understand well and continue where you left off the last time you worked on code.

     Before joining Pernix, l boss told me to do the game Tic Tac Toe, and makes the game properly served but did not have good programming practices. Looking at the code after some time, there are many errors like this (code).

     Now after reading the book Clean Code. What we can correct for it is simple function?

     Comments that are at the beginning of the function, are useless (Error 1), so the function does not have a meaningful name (Error 2). The function has 18 lines of code should be maximum 5 lines of code (Error 3). What is the meaning of the following variables? 'row', 'column' and 'diagonal' (Error 4). Which means that some of these variables is true? (Error 5). The code must be in English (Error 6) and must follow programming standards (Error 7). Now, if we correct this code should look like:

public boolean isThereAWinner(Board board){
  if(checkRow(board) || checkColumn(board) || checkDiagonal(board))
    return true;
  else
    return false;
}

     When written CLASSES, these should be small and should not have more than 100 lines of code, if you have more than that, the class has too much responsibility, example (code). Here is a class that has more than 500 lines of code. Has giant methods and also which are very difficult to understand. Perfectly is class can be divided in 3 classes of less than 100 lines each, and each would have its own responsibility and not mix.


     This is what it means to me, Clean Code.

miércoles, 18 de diciembre de 2013

Ruby - Example 1 - Syntax

To start, you need to be clear, how to write code correctly. To do this I will explain how you should declare variables, modules, classes, constants and methods (functions). Before continuing, it is necessary to note that the words we use must be significant, i.e, should be self-explanatory and should not be ambiguous.

First, I'll start with the "Classes" you should always have a syntax in "CamelCase" format, in the same way, this also applies to the creation of "modules". Then I will set an example for that case.

class Car
end

module SportsCar
end

Second, for the declaration of symbols, variables and methods (functions), you should always use the syntax "snake_case" i.e, always write in lower case and if the word is made up of 2 or more words it should be separated by an underscore "_”. Well, now we will show an example of each.

def some_method
this_is_a_varible = 3
end

Last but not least. Always, you should remember the "constants", these should always be written in capital letters, if there is more than one word they must be separated by an underscore "_".


THIS_IS_A_CONSTANT = 4