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.

Saturday, June 21, 2014

Spikes - Discovering Worlds

It is common that developers are always facing new challenges, many of them are small or affordable and someone has already solved a similar problem in the team or in the Internet. Other times they are facing completely new developments and they have no idea of to deal with these.
The risk can be very large and the time to implement the new requirement could take some days or even years. After coding the requirement, if they can, developers have to test how the entire system is working and whether the expectations are met. Nothing seems clear and is hard to see land in the sea. It is necessary to do something more before to estimate the difficulty and time to implement the requirement.


Spikes


Spikes are an invention of the software methodology Extreme Programming (XP), Spike is to develop an implementation of something related to a potential requirement. Why is it necessary to make a Spike before a requirement?
Spikes are useful when the requirement is to make an architectural change, proof a new technology, add a big feature or change a current implementation and check if that is possible, it is also useful to knows better the time it will take the development, how the implementation is affected, and check if the functionalities will have the expected behavior. Definitely, the requirement is very immature and needs some work to become a requirement with approach achievable.
Moreover, they are used for research, design, prototyped, or increase the knowledge and reduce the risk of a technical scope. Also, a Spike can be estimated.

Spikes emerging


All requirements have to build risk functionality, this unknown information can be discovered while the requirement is being constructed, in a team conversation, using the criteria of the developer, discussing, collaborating, negotiating, etc. The team determines to do a Spike when the risk is high or they really need to know more about a requirement that may be very big. Using Spikes the team will get the information with convincing data, then team members can see and take better decisions.
When the team or the Product Owner determines that they have to make a Spike, this can be estimated and prioritized as other requirements. The greatest value of a Spike is the information obtained, not the code developed.

How to aboard a Spike


The recommendation is to implement a spike with a small program. It is important to research and read, but even more important write code to experiment, not only theory. The complexity should be ignore, just have to focus on getting something working, no matter if the code is not reusable because this is an experiment. Document and display the results to colleagues is essential. Avoid the production code when it is possible, if not, only go ahead and do not commit anything.
In a Spike, developers can not go deeply in the beginning because these Spikes are not well defined. Who is researching on that mist can be lost in the sea of information or trying to do many things at once. Also it is important to have in mind that Spikes don't deliver value to the user directly, hence they must be used with precaution.

Finally, Spikes can be useful sometimes, but the most of the requirements do not need to use this kind of development. It is important to take a while to decide whether is needed a Spike and this time to think may be critical in many cases for the project's future.

Saturday, June 14, 2014

Servers - Compute as a Service

Does someone know you? How will you get it if nobody can communicate with you? You are alone and you talk anyone more than one person at a time. Tomorrow 2 hundred people will request to talk to you, after tomorrow one thousand, and the number may continue to increase. How can you deal with that? What do you have that is very important for them and for you?

What is a Server?


A server is a computer that provides services to other computers on the network, it is clear that this is a basic definition for a server. All the computers can be a server, it is not necessary to install a special operative system to do that.
The real servers are computers that are working 24 hours, seven days at week, they are stable, have fails recuperation, etc. A server can be one computer or just one computer connected with other computers or electronics devices working together.
A server can provide file sharing, printer sharing, shared applications, customer management, database server and more. Thus, in the case of file sharing, it has the ability to store folders and files in one place (in the server) and the user can access and update them. In a Web server, the users can access to the information with a browser (Chrome, Firefox, IE, etc.) and see or interact with provides pages such as Google, Facebook, your own blog, company Web Site, and more.

Server Operate System


The server Operate System (OS) is an alternative when is needed something more powerful. Also, they are more robust, secure, stable and expensive than the common OS. These can withstand thousands of users, but in these OS is harder to have the same software installed on a standard personal computer. Authentication also is stronger, nobody likes bugs that hackers use to gain access to sensitive information about his company and the servers are exposed.

Server Hardware


Similar to the case of server OS, if a particular behavior is needed in the server, then a special hardware is required. This hardware can be more than one power supply to keep the server always providing services, more than one hard drives, network management, and more, there are many types of hardware for servers. The processor and memory also are important to withstand many requests and applications. 
The hardware also aims to ensure that the server is always running and providing its services, this never should be shut off.

Companies can improve when they use servers, their processes can move more agile and powerful. The products of the company can work using server with specific services and the potential customers can learn more about the company in a Web site. It is necessary to remember that the server is one thing and this works with software that provides Web Sites, Web Services, or other applications to ensure the future of the business.

Sunday, June 8, 2014

Maven - Managing your Life


Think in a world in which you are alone, you are not depending of anyone, you do not need anything other than yourself, you can do your task and survive only on your own. If you like that, then you can do only few things on your life.

A Java Project doesn't work alone


 Build a Java Project might seem simple, it is needed to compile the Java classes and get the functionality in a .jar. However, in other cases, like a larger Java Project, which is using a lot of different projects as dependencies, is more difficult to handle because these other projects have their own versions. If there are many projects working together, each with their versions and dependencies chain, then automatize this is needed. Time can not be wasted on repetitive task, the concern is to write code. And good code is needed.

Java Projects together are Stronger?


Someone can say "To manage my project without depend on anybody, I will place all java classes into a single project". Someone can do this, and can do whatever you want, but it will violate all good practices and design recommendations and it will be a messy project that nobody will be able to maintain because it is not separated in component with different purposes.

When a smarter project is built using a little of common sense, this project will have a purpose and it has one responsibility. In this case, there are several projects working together, each of them knows what projects need to get its job. They are not working alone and when it is needed to fix something or add a new feature, then it will be easier to know where to start coding. Your design makes sense now?

Maven takes the control project's life

Maven can help when there is a Java project and repetitive task such as versioning and dependency management, which can become a headache. The names of the projects and the version are specified only once, and the team is concerns in to code or other more important activities. Likewise, the project coded also has version, then it can be referenced by others.

If this project is build using other projects that are being coded, then everyday you can get the last updates of these dependencies. You can be sure that everything is working fine and the last update of the current version (Snapshot) is doing the expected work. 
Maven works with repositories, which contain the .jar projects needed and downloaded. Exists other repositories where the jar is deployed, the developers are not working alone, and everyone has to work with the latest version of all.
Maven uses simple commands to build an entire project, these are repetitive and follow some standards like folder structure where is the code, test, resources, etc., the issues to manage the project are reduced.
The java code is used to get the functionality and the pom xml is used to manage the project, that file is what Maven understands, this is the project itself.

It is more than that

Maven plugins are use with different intentions. They can be used to run tests, deploy to a server, generate reports, etc., there are many of them and always are added more. An own plugin can be created.
The archetypes allow to build a War, an Ear and a Jar project among many others, it can be added with Spring, JSF or another technology, only using a simple command. Start coding in a new project rapidly, seeing their results, is easier. In the case in which, there is not needed to follow the same structure of the archetype, is allowed to change the project structure because the pom generated can be modified.

Like their projects, Maven is not working alone

There is an Open Source community that is integrating Maven with other technologies such as Hudson that needs to build project and run the automation test. Also uses plugins to deploy automatically a project on a server and has much more things to offer.

Maven has disadvantages too, here are some of them:
  • The pom file can be very large. If the project uses many dependencies and plugins, then there is no way to separate this.
  • Two dependencies of a project may need the same dependency, but with different version. Transitive dependencies are harder to handle
  • A dependence that doesn't compile can need other dependences (transitive dependence) and is needed to update and compile it in the case that is under build.
  • The build cycle can be slow, but its steps are necessary. It needs to download all dependencies, compile, run tests, install and deploy. Some steps can be ignored if it is needed.

Maven manages the life of a project. It has some deficiencies, but it makes its work and does it well.



Rule Engines - Software taking decisions

Think how you take your decisions on your life. What criteria do you use to select your work, pets, house or a school for your children? You know that some decisions are more important than others, the rest of your life may depend of some of them. You don't overlook the key decisions.
Would you like to have the information to take better decisions? Decisions are based on facts and previous experience. Are there some rules that can guide you to get what you want?

Automatizing Decisions


A system may have the capacity to take decision using its knowledge base. Their knowledge base is nothing more than conditions and actions. If conditions are met, then the system decides actions to take.
Moreover, the conditions and actions are not randomly selected, there are specific domain experts who have the knowledge to recommend  the best decision depending of the facts matched. A system also has the ability to automate decisions, experts only determine under what conditions the company has to take the actions. In other words, if the conditions are true, the actions are executed.

Rule Engine


The Rule Engine is who examines the rules by the inference engine, say, is a software that helps manage system rules.
The rule engine is code that works separately from the code implementation and has the possibility of change without having to ask for help from programmer. Domain experts can apply new rules and make changes whenever they want.
A standard rule engine may include: A Business Rule Repository that is a database to store the business rules, a Rule Engine Execution Code that has the currently programmed code to enforce the rules and a Business Rule Editor that is an intuitive user interface to define, edit, document and design rules.

Business users can define rules


With verbalization, user can define the rules using their own language. Naturally, they define the conditions and actions to be taken without changes in the code program, separating the programmer work and definitions of business analysts.
The verbalization can be asserted with different sentences, many of them can mean the same, focusing in the expressivity, clarity and formality.

Varieties of Rule Engines


There are many types of Rule Engines, these can have inference rules or event action condition rules, use Java code, C++ or others, be Open Source or not. Some of them have more features like decision trees, decision tables, rule flows, version deploys, simulations, reports, etc.


The rule engines helps you to decide "what to do" and not "how to do", it separate the domain objects with the logic that is in the rules, minimizing changes in the future, also provides a good design application when it is used adequately.

Thursday, May 1, 2014

Agile Retrospective

The teams that are implementing Scrum, or some derivative of this, has an event calls Retrospective. The Retrospective is a rite where the team meets to the end of every iteration and the goal is to improve, in practice is identifying strengths and weaknesses to decide what and how to improve. The continuous improving remains, what is a base for all agile environments.
Thus, team adapt and change, surviving in this industry that favours velocity and Software on time, being the basis to keep business, to overcome others companies or to find new unexplored markets.
However, this is not only to make retrospectives to accomplish the Scrum process, these are some professional issues that I have seen:

·        What is going on when we proposed 20 improvements to make? I have no doubts that none of these improvements will be done, these are many ideas and is a hard work measure them. These are so many that the team can’t focus on none of them.
·        What do we do in the retrospective? This is not meet the team and say how good, bad, beautiful and ugly was the last iteration. Many participants may be thinking about what tasks they must deliver, and others in the way we are wasting time, or even some grateful to be away from your daily routine for a few minutes.

The above mentioned and many other situations happen during the Retrospective. When the team feels that it is a complete waste of time, then is better stop doing that.

Here, I’m going to mention some bases and ideas to conduct a Retrospective‘s meeting successful:

·        Each team has different needs and situations. Some teams have bad communication, others lack coaching, need learn new ways and practices about how to develop Software, do better Stories, or more test automation. The retrospectives are guided to the current needs of the team.
·        We must have an activity plan, depending on the amount of people and time assigned. Well as to consider the steps that can be: presentations focus people toward retrospective, collect data and situations that occurred during the iteration, find patterns, propose ideas, and finally the close. The book Agile Retrospectives (Esther and Diana) mention the possible phases and detail a number of activities to select during each one.
·        When the team find things to improve, it knows what are the most important. Thus, the team has to prioritize and choose a few (e.g. two). So, the team knows what it will do and must be improve, setting responsibilities as appropriate.
·        In the retrospectives, we work with people, therefore, we have to consider their emotions, energy and attitudes.

And lastly, the retrospective can be use on any team that is dedicated to develop Software or other work too, is not required to use Scrum, only the will to do the job better, be a better team.


I stay with some unknowns: How do I take a retrospective on line? How do I guide the team leader to do the retrospective otherwise? How to choose activities according to the situation of each team? 

My Motivation

We can’t touch the Software, but we can create and see it. Sometimes is elegant, while in others we just want to scream and run.
The Software is longer than zeros and ones, is all these together for to create something bigger, more complex, something that nobody has imagined. The zeros and ones are more basics than atoms that compound molecules and after, more complex being. The binaries are the beginning and maybe the end.
The Software is like the art, is a human being creation. And yes, it can be as beautiful and to have nothing to envy the greatest works of the world.  The main goal is overcome them.
The zeros and ones go beyond what you see, because their creation can be done by many people. The communication and relationship between people have a potential, and must be exploit.
Well, zeros and ones are like children. Therefore, they are our responsibility, we could mourn happiness by a good creation and be proud of a job well done.

I dare to admit it, it’s what moves me.