Vuoi lavorare con noi?
Per un accesso privilegiato, scrivi una mail all'indirizzo andrea.angella (at) red-gate.com
The FlowA mental state of operation in which a person performing an activity is fully immersed in a feeling of energized focus, full involvement and enjoyment in the process of the activity.
I never known exactly how to achieve high cohesion and loose coupling regularly until I started writing isolated tests, Kent Beck
I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris). If I don’t typically make a kind of mistake (like setting the wrong variables in a constructor), I don’t test for it. I do tend to make sense of test errors, so I’m extra careful when I have logic with complicated conditionals. When coding on a team, I modify my strategy to carefully test code that we, collectively, tend to get wrong. Different people will have different testing strategies based on this philosophy, but that seems reasonable to me given the immature state of understanding of how tests can best fit into the inner loop of coding. Ten or twenty years from now we’ll likely have a more universal theory of which tests to write, which tests not to write, and how to tell the difference. In the meantime, experimentation seems in order. Kent Beck
The point of the walking skeleton is to help us understand the requirements well enough to propose and validate a broad-brush system structure.In most Agile projects, there’s a first stage where the team is doing initial analysis, setting up its physical and technical environments, and otherwise getting started. This is usually called Iteration Zero.
Casio graphic calculators use a BASIC-like programming language but variable names are restricted to single letters A-Z which are shared by all programs including subroutines which are stored as separate programs. This means there are no local variables, they are all global. These variables are also shared by other functions of the calculator. For example, drawing a graph will overwrite the X and Y values.
"If it’s work, we try to do less. If it’s art, we try to do more." - Seth Godin
Software is my art.
Legacy code is simply code without tests.The goal of every competent software developer is to create designs that tolerate change! This is why it is critical to learn how to confidently make changes in any code base.
Preserving existing behaviour is one of the largest challenges in software development.The three main questions to ask are:
Legacy Code Dilemma
When we change code, we should have tests in place. To put tests in place, we often have to change code.
It is important to know what can be affected by the changes we are making!Effect Sketching is a useful technique that can be used to answer this question. The idea is to create a little graph that shows the effect of your changes. Navigation tools like ReSharper can help you identify all usages of a particular piece of code. However, if your class has a superclass or subclasses pay attention because there might be other clients that you haven't considered.
Working in legacy code is surgery, and doctors never operate alone.Consider reading the book Pair Programming Illuminated. Refactoring
The best way to get better at finding responsibilities is to read more books about design patterns and in particular to read more code.
Programming is the art of doing one thing at a time!Ask your partner to challenge you constantly asking: What are you doing?
Remove duplication as much as possible!You end up with very small focused methods. The goal is to have orthogonality in the system. Your system is orthogonal when there is only one place you have to go to make a change. Removing duplication often reveals design.
Remember, code is your house, and you have to live in it.Rename Class is the most powerful refactoring. It changes the way people see code and lets them notice possibilities that they might not have considered before.
A method should be a command or a query, but not both. A command is a method that can modify the state of the object but that doesn't return a value. A query is a method that returns a value but that does not modify the object.Extract Method is a core technique for working with legacy code. You can use it to extract duplication, separate responsibilities, and break down long methods. It is also recommended to extract methods in a bottom up approach. Extract small pieces first!
In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.I think that learning design patterns and the underline Object Oriented Design principles is really important. However, it is really difficult and time consuming. It requires a fair amount of discipline.