martes, 9 de octubre de 2007

If XP is eXtreme Programing, SP must be Stupid Programming.

If XP is eXtreme Programing, SP must be Stupid Programming.

I've been in several software development projects in the last 15 years.

And since for the past few years the economy has been booming (and also many people are attracted to this kind of job), I suppose all the good people are scatered, so the average quality of the projects seems to be fading...

In the last too projects I've been I've seen something that I, for lack of a better term, unapologetically call Stupid Programing.

Or "Just Program It".

Now I understand managers. Developers really solve one thing and destroy another, so they are kind of stupid. They can't see past a few lines of code (or a few thousands if he is really good), but most of the time the process seems to be out of his control.

I do this myself all the time, but with a lot of care. I don't mean that I code meaninglessly, but something completely differently.

What do I do?

Simple: I suppose that resolving the general case is solving the first particular case, then the second and so on. Continue untill all particular cases are solved. When the process is finished, you have built an abstraction. If somehow you arrive at a contradiction, it means the abstraction you have built is wrong, must be discarded and you must invent a new abstraction that solves all the previous cases PLUS the new one, and also you should try to foresee if the new abstraction, at least conceptually will be able to handle the cases left.

The only problem I see is that when they solve the second case, they don't care about the first case, so they break the whole application everytime they touch anything. And since you can't keep a very big application "all in your head", this is a very good way to get job stability, since other developers will have a hard time getting this in their head. So development "never ends". It is always declared to be 95% or 99% and there it remains, no matter how much money you throw at it.

If you haven't seen this, you either lack experience or you are doing XP, in which case you will lack this particular experience in the foreseable future.

XP

XPers got this right. You have to understand the code. Everyone on the team should understand the code.

So XPers insist in that you pass 100% of the unit tests all the time. Make a change, compile everything and pass all the tests. Waste of time? If you are repeating your code all over the place, of course it is a waste of time. But if you are repeating your code all over the place without doing unit tests you are also wasting your time, and maybe even more so.

You do a change and you have no freaking idea of what will work and what will stop working. So you have to restest the whole application, but these manual tests require that you set up the corresponding data, so the results of the tests depend on the mood of the tester.

Stop wasting your time. Stop repeating your code. Code once. Then simply use it.

Avoid repetition so that your code is manageable and maintainable.

Avoid SP altogether. If you are doing SP, we are not understanding the code and therefore the probability for the project to be a failure is simply too high. If you decide to stay with SP I hope you don't care if the project fails. Sometimes projects are so small and irrlevant that you can afford them to fail, because you can completely redo them in a single day.

But let's face it, those projects are uninteresting. Interesting projects are big and require a lot of coordination.

Most shops that claim not to be doing XP do it for the wrong reasons. They think writing documentation is forbidden in XP. They also think doing SP is the correct way to direct projects. If you are flippling burgers, maybe "just do this" is the correct way to do it, but flipping burgers is a contiuous operation, while a software project has a duration and after that the project doesn't exist anymore, because of the very definition of project.

No hay comentarios: