Saturday, May 26, 2012

Is starting over a solution?

Even with the best intentions of everyone involved and regardless of their efforts, the design of a system at some point can head down a slippery slope. The deterioration of a good design is generally a slow process that occurs over a relatively long period of time. It happens by continually studding your classes with hacks and workarounds, making a large share of the code harder and harder to maintain and evolve. At a certain point, you find yourself in serious trouble.

Managers (and/or architects) might be tempted to call for a complete redesign (reboot), but redesigning an evolving system is like trying to catch a runaway chicken. You need to be in a very good shape to do it. But is the team really in shape at that point?  Have you ever seen the movie Rocky? Do you remember the scene where Rocky, the boxer, finally catches the chicken, thus providing evidence that he's ready for the match? During the movie, Rocky attempts several times to get the chicken, but he gets the chicken only when he has trained well enough.


From Microsoft .NET: Architecting Applications for the Enterprise

Object-Oriented Design Principles

Find Pertinent Objects First
Favor Low Coupling- Program to an interface, not an implementation
Favor Code Reuse
The Open/Closed Principle : A module should be open for extension but closed for modification
Dependency Inversion Principle : inversion of control (IoC). Dependency injection

Design principles

A principle that is helpful to achieving high cohesion and low coupling is separation of concerns (SoC).

KISS: Keep It Simple, Stupid (Keep it as simple as possible, but no simpler)
DRY: Don't Repeat Yourself
OAOO: Once and Only Once
YAGNI: You Aren't Going to Need It


Every line of code you write can and will be used against you in a code review session.

Monday, May 21, 2012

Cyclomatic Complexity myth in software development

From time to time, I heard people saying something like “Our system is very complex, so it is understandable that the cyclomatic complexity of our system is high”. That is a myth; no matter how complex the business process is, as long as we design and program it right, we still can maintain the cyclomatic complexity < 25 for all members of all classes in the system. The real question is how good or how committed we are as a programmer or a software manufacture.

Friday, May 18, 2012

Make them happy

Happy hens produce more and better eggs.
Happy cows produce more and better milk.
Happy programmers produce more and better code.




Wednesday, May 16, 2012

Start a trip with a punched tire and start a software development project without maintainability in mind

The common characteristic of them is you  can get somewhere, but not too far; sometime you may never reach your destination.