Saturday, September 22, 2018

Understanding the SOLID principles


Last week we listened to a podcast where Bob Martin was interviewed about software craftsmanship and techniques to make coding better. He also developed 5 principles he recommends to enhance object oriented programming, which are the following:

  • Single Responsibility Principle: This is that the class we are working with, needs to be useful for one thing and one thing only. In a previous text, we learned that we could use compositions to avoid making several things on one class. The theory is easier to grasp than the practice. In practice, you must rely on experience and common sense. Not following this practice may end up in a developer really frustrated trying to understand what the class is doing.
  • Open/Closed Principle: Any class should be open for extension but closed for modification. For that we probably need the skills Bob mentions on the past article, so we gain experience with making code difficult to break, and at the same time, be accessible, easy to understand and introduce new functions and features. The principle means that when adding new behavior you should leave base classes alone and instead create new, inheriting classes
  • Liskov Substitution Principle: This principle is in charge of  keeping the happy working relationship between classes and functions alive and well, when one class inherits from other. Experience tells us that changing the behavior of a class in many cases leads to problems elsewhere in a code base. It is another example of how you should strive to minimize dependencies of all kinds in the interest of writing robust and maintainable software.
  • Interface Segregation Principle: Avoid writing huge interfaces that give classes a lot responsibilities they don’t need or want. The developer needs to have the ability to instead create a collection of smaller, discrete interfaces, partitioning interface members according to what they concern.
  • Dependency Inversion Principle: This principle means is that instead of writing code that refers to actual classes, the developer should instead write code that refers to interfaces or perhaps abstract classes.





Saturday, September 15, 2018

Software Craftsmanship

Bob Martin gave an interview about craftsmanship software and agile software techniques, which are directly correlated, because craftsmanship tries to up the developers skills and the agile software techniques are the ways a developer could improve them. Bob also thinks that they have a lot in common.

Bob talks about how we, as developers, get the craftsmanship of the software when we are in our jobs, in some sort of trial and error manner, this happens as we are building our skillset so we can build better code faster, but Bob thinks the developers need to learn this things on school, so instead of trial and error, it could be more like an educated guess. I’ve learned a lot of nontechnical things on my jobs, things that may take too much time to put them on a course, also, seen those things in practice helps clarifying a lot of things a developer may not understand with the theory.

We also try to develop our agile software techniques so we can solve our coding problems faster. Companies learn from their and others mistakes, so they create standards to ensure the employees get the right focus on the right skills, so they get small things done very quickly, making easier the error detection. This agile techniques, allow developers to get things done in less time and focus on bigger problems.

Not all college developers have a good craftsmanship, because not all have the opportunity to get a job o just don’t want or have the time, but this skills are necessary for the developer to get their work environment ready in no time when they get their first job, that’s the reason students need to get that experience from bigger college projects or projects that are not necessarily part of any course.

Saturday, September 8, 2018

War games

War games is an 80s movie that talks about a machine that could simulate several war scenarios depending on the current conditions of each county involved in that specific war. This machine was created because there was a test for soldiers if they would be able to turn a key to activate a nuclear bomb to kill dozens of people. Turned out, soldiers weren't able to turn the key because they thought of all the people that bomb would kill, so this machine was built because doesn't really care how many people die if it needs to throw a bomb.

In the other hand, there is a geek guy called David Lightman that isn’t really interested in school, but he is really good at computers. So he change his and a friends grade so they pass the course. The movie were filmed in the 80s, so the internet was very different, he had to connect through dial up, so he put his computer to dial all numbers in the area of a videogame company so that he could get info on a game that isn’t out yet, he found what he thought was the company's files of its games, but then he looked that there were games with strange names like “global thermonuclear war”. That game ends up being the machine the government created to simulate the wars. The machine was created by Stephen Malken, who was an AI researcher when the machine was built, so it could learn more as the simulations were finished.

David started playing with the machine as the Soviet Union not knowing that he really started a simulation that would trick the military into thinking they were under attack. They tracked David down and explain to him what he has done.

The machine can’t really tell that the US is under attack, so he tries to launch lots of missiles. David tried to convince Stephen to help him stop the machine. He realized that the machine won’t stop playing even it has no chance of winning, so he put the machine to play tic tac toe so that the machine learns that there could be no winners, so it applies that new concept to the war simulator and discovers that, in some cases, the only way of winning is not to play, so the missiles were not launched.


Saturday, September 1, 2018

Is Design Dead?

Is Design Dead?
The article talks about how the design has evolved over the years, and developed good practices to create a good design with ease.

Like in other areas, we, as developers, have tried to develop a way to create good design. Many other areas already have good standards on how to create a good and effective design, but in computer science, we’ve still not refined the methodology just yet. But we’ve discover some things that make a good design, for example, our code has to be somewhat modular, it has to be easy to alter, because the system probably won’t stay the same for the rest of the days, it’ll probably need maintenance, so a good design, should allow easy maintenance and the new features should be easy to incorporate. It is harder to modify a design in the middle of the development, even if the changes are good, because things need change to adapt the new design and there could be more bugs at the end.

Design should be done before development. Designing the software while it’s being built could end on a project with no Quality Assurance, it could take longer to develop and most likely have a lot of bugs. The software designers first create the design of the entire project, so they can get all the informations and sort the bigger problems, so they are not distracted by the technology programmers use. Then programmers follow the design so they don’t have to worry about other stuff.

Software should be simple, the team has to be focused on what is important now and build only the features needed, they don’t need to waste any time and resources building features that could be used in the future. This is, creating the least amount of code possible. Reusable code should be used properly, so that there is no duplicate functionality.

Saturday, August 25, 2018

Who Needs an Architect?

The article is about how software architecture can be seen as two different things, one is that the architect understands the general scope of the system, so that he makes the correct big decisions, the other one is that the architect tries to solve all the issues possible.

To me, the first one fits what I think of an architect, I think a software architect should be someone that builds the general idea of the project, divides it into small chunks of important stuff the system has to do. The technology that needs to be used doesn’t matter to the architect at the early stages, the team first needs the requirements of each of the components of the project to decide, based on the requirements what kind of tech or programming language they are going to use. As we can see, that is pretty similar to the first definition the article gives.

Also, the article talks about how the architect could make thing easy to change, so we don’t need to know all the specifics of the project at the very beginning, so we can avoid complexity in the system when we need to make a significant change, but making some things easy to change, the system gets more complex, and if we make everything easy to change, the system gets very complex, so we defeat the purpose of trying to make the system less complex in the first place.

Many authors make the comparison to building architecture, which in many cases makes sense because there are a lot of similarities, but the article makes an excellent point, software architecture is not limited by physics, so, in many cases, software architects have a lot of freedom, but that could be a double edge sword, because it is easier to make a mess.





Fowler, M. (2003) Who needs an architect?. IEEE Software.

Who needs an achitech

The article is about how software architecture can be seen as two different things, one is that the architect understands the general scope of the system, so that he makes the correct big decisions, the other one is that the architect tries to solve all the issues possible.

To me, the first one fits what I think of an architect, I think a software architect should be someone that builds the general idea of the project, divides it into small chunks of important stuff the system has to do. The technology that needs to be used doesn’t matter to the architect at the early stages, the team first needs the requirements of each of the components of the project to decide, based on the requirements what kind of tech or programming language they are going to use. As we can see, that is pretty similar to the first definition the article gives.

Also, the article talks about how the architect could make thing easy to change, so we don’t need to know all the specifics of the project at the very beginning, so we can avoid complexity in the system when we need to make a significant change, but making some things easy to change, the system gets more complex, and if we make everything easy to change, the system gets very complex, so we defeat the purpose of trying to make the system less complex in the first place.

Many authors make the comparison to building architecture, which in many cases makes sense because there are a lot of similarities, but the article makes an excellent point, software architecture is not limited by physics, so, in many cases, software architects have a lot of freedom, but that could be a double edge sword, because it is easier to make a mess.





Fowler, M. (2003) Who needs an architect?. IEEE Software.

Tuesday, August 14, 2018

Software Architecture

Software architecture is a very important phase on a project, because it can present all the parts or the
necessary things it will need. By having a greater context, not just, single functions, the software
architect could review the “blueprint” in search for errors or requirements not totally satisfied.


At this stage, a change on requirements is not a huge deal, like we saw on software modeling, a
change on requirements will cost more time and money as the project is close to completion.


As Googliffe stated in his book, we need to find a balance between the software’s architecture
being too general, that we can’t understand the scope of the development, or too specific,
that a simple change of requirements will have a big impact on the design.
All software projects need some sort of architecture if they need to be finished on a reasonable
time, even the smaller ones. As the project becomes bigger, it’ll need a bigger architecture,
but it has to still be compact, so everyone, even outsiders of the project, could get a grasp of
what the project is about.


I think the examples given of software architecture comparing it with building architecture is
great because they have same type of success on the project, and a change once the project
has begun, could compromise the reliability of the project and could not be ready for launch on
the due date.


The architecture is about knowing what components of software do, and how they interact with
each other. The implementation and how they work isn’t on the architect’s worries.


Not all software is created equal, so there are many styles to create an architecture. For starters,
we need a good architecture, a project with no architecture most likely will produce more problems
than it solves, “cheap gets expensive”. The most common is the layered, which stacks components
as if they were blocks, one on top of the other, so the top components doesn’t get affected if a lower
component gets changed. The pipe and filter are just components that take data, modify it and pass
it so other components can do the same. The client-server just relies on a external computer(server)
to do the heavy lifting, and then it returns data to the client. Component-Based architecture works
by dividing the project into smaller pieces which talk to each other, all of them solving different
tasks. Finally the Framework is just a collection of predefined methods and functions that a
developer can use to simplify the project and waste less time.


Goodliffe, P. (2006). Code Craft. S. Francisco: No Starch Press.

Ethical Reflection on Ready Player One

Ready Player One is a novel about a distopic place in the future where whats initially was a videogame, turned into a new world, where peop...