Sunday, August 24, 2014

Clean Code - Social Act

How many times as programmers we have felt perceived like solitary people who are working in front of the computer, maybe sometimes we accept that because our code is something we can create alone or seeking resources from the Internet. Nothing further of reality when we are working in a team.

The act of programming


The developer creates or modifies other existing code and adapts the functionality to implement. The programmer thinks in the best way to make its code understandable to help to someone else to understand rapidly what it does and the changes will be more accurate. The programmer is not a solitary entity, it works with other people's code. Programming is a social act. In that way is presented the art of develop Software in the book "Clean Code".

Communicate


The book, or bible of programming for others, focuses in facilitating communication of the code's intention, with its functions, classes, variables, etc., Why is that so important? Because nothing guarantees that the same developers will work in the same piece of code, it can be assigned other task or is not longer part of the company. In Software, the code is one of the best documentation that someone can leave and it has a purpose, a reason to exist, and it is better to communicate it easily being coherent.

Fundamentals


The book recommends as must be formed a class, the best choices of names, variables, functions size, levels of abstraction, principles of responsibility, and others. It explains why small is better, helps to choice appropriate names and the importance of provide it with a common format code, the author makes strong criticism of the code comments that explain something that can not be done by itself,  in addition to provide a lot of heuristics that serve as a guide in the moment of codify.

Recommendations


The author does not ignore the design. Add or change code, however small it is, it has a grade of impact on the design of the system and condition its evolution. The author also covers principles that help to make a work of a professional developer, something serious and trusted with value, all our coworkers surely are going to thank it, because will not be a headache read this compass lines that follow an identical rhythm at the programmer reader. There is not to forget that we are in front of recommendations and many of these are questionable or even open to improve, applicable according to criteria.

The book follows the premise that the Software codified evolve, its complexity grows, and unless you are the first writing code, you have to understand what the existing code does, and that takes time. Programmer is talking to oneself and with other developers, a common language, conventions and fluency are fundamentals to achieve a good communication.

Sunday, August 17, 2014

JSON attraction

When something is becoming more complex and it is doing more things you need to do, then that begins to wasting people's time, communications and developers.
People like simple formats, these are easier to understand and have only the necessary things for what they really need to do.

XML came


Something like this has happened with  XML and JSON, first XML arrived to our world to meet the need for a separate standard programming language for exchanging data between different kind of platforms and this was solved it in an elegant way. Thus, each time that was needed to interchange data between two different platforms regardless of the programming language in which these were built, it was used XML. The data was using it, data bases were sending data using it, SOAP Web Services also used it, etc. It was the only option.

JSON came after


Then came some alternatives, one of which was JSON that was reaching the same goals of XML with some differences that made some things easier and others harder. Developers have more options and they can adapt better to the need of their platforms. It came with a promise to be faster with a lightweight format that is less complex than its predecessor.

Qualities of JSON


One advantage of JSON is its relationship with AJAX that needs to load data quickly and asynchronously without delaying page rendering. Social media pages need refresh their pages plenty times, small optimization can have a big impact on the efficiency and performance of a Web application. In addition, Big Data applications came with their own need, some of them were store and manipulate their colossal quantity of data, and JSON provides a faster way to use those giant data bases based on document files.
JSON is a data interchange format and it focuses in a simple way to enable validation and parse that are implemented in the language that is using it format, providing an easier way to handle its nested elements. In contrast, XML parse data using a required DOM (Document Object Model) or a Schema for the client side when it requires an XML response.

Considering the size of the XML and JSON documents, due to the complexity of XML, this uses a higher bandwidth when data is sent over a network. If we also consider more devices like iPhones and Tablets are popular today, such amount of data over a slow network cause delays page loads, hang ups and poor user experience. Currently XML is widely used and has its own benefits, but JSON has become the preferred for exchanging data on the Internet in recent years.