tirade - [tahy-reyd] "a prolonged outburst of bitter, outspoken denunciation"

Archive for May, 2009

Design

May 21, 2009

If a little is good, a lot isn’t better

Tags: , , ,

Lets talk about garlic for a little bit. I love garlic, I know that not all people love it, I do. I think a little garlic is very good and brings out the flavour of a lot of other food. Love it or not, I think we can all agree that some dishes are better with garlic, but not all dishes. I’ve never really liked garlic in my ice cream and that does not make ice cream or garlic evil, they just don’t go together. And sadly, yes you can use to much garlic, even on a pizza. So… while a little garlic is great it does not mean we should put a lot of it on all of our food, right?

So why do so many people make this mistake in software development? In my career I have rescued lots of projects and most of them where because of over engineered crap! People being really clever! Only two projects suffered from lack of process and no design and these are easy to fix so that the project is on the right path in no time. The rest have all been this giant balls of patterns, layers, abstractions, and all round cleverness and these are always very hard to fix. Now before you hit the comment button; I know these are all good, pure, holy and necessary things, but for fuck’s sake all things in moderation.

Factories rock, but not every instance of every object needs two be created by some factory managed by some manger via a facade onto a proxy delegator command adapter decorator visitor thingy. How many of your factory interfaces have only one concrete implementation that creates the same instance every time? How many of your application layers are just simple pass-thru calls in reality? Does every single object in your application truly need to be Spring managed?

So next time you add an abstraction, a layer or any clever trick in your design, please stop and think. Don’t ask yourself if what you are doing is right, ask yourself if what you are doing is right for this situation, is it the right tool for this job, does the system really need this extra complexity, is this as simple as possible, are you future-proofing, are you doing too much of a good thing?

I think that some people are just serial over-designers that will never be convinced that a system can be over-engineered, but not everyone. So please don’t be one of these people! Please stop and think. Remember, there’s a reason why the old principles have stood the test of time! KISS, YAGNI, MoSCoW. Don’t be a Rube Goldberg systems designer.

Development

May 18, 2009

Dogma or belief

Tags:

 

Do you believe, now choose

We started a new project a few days ago and it was agreed that we will do unit testing. One of the guys (who incidentally have done tons of unit testing before) asked that we lay down some rules, like: Every method in the application layer must have at least one positive test.  Or: You are not allowed to check in your code if you do not have 100% code coverage. 

 

I thought about this and about why it does not sit well with me. So this was my reply:

Unit testing is all about belief, and not about dogma. You should have faith in your test and you should test out of principle. You should write test where they are needed and you should write as many as needed because you believe in their value. When you make these dogmatic rules people end up following the rules and forgetting their beliefs.  You many end up with too few tests because the developer automatically stops after the mandatory two tests even if more tests are needed.  You’ll end up with crappy tests because the developers write “filler” tests to make up the mandatory numbers. But mostly I think that dogma stands in the way of belief, and you want your entire team to belief.

People will go the extra mile and further for something they believe in.  They will constantly find ways to make it better. They will tell others how great it is. They will do everything it their power to make is work, to make a success of it. People that believe in testing will write great tests, tests that are thorough, tests that enable change. If it is about the dogma, people will just follow the rules or find ways around it or write “filler test”.

In my experience belief works and the dogmatic rules only gets made if the belief is already missing. What do you think? Do we need the dogma if we have belief? Is it not better to convert the non-believer that to make more rules?

Licensed and Generic products for canadian family pharmacy !&;[ buy maxalt online used to treat erectile dysfunction. Trusted source for Canada pharmacy @*(* medicines online with the best prices. Learn about an online pharmacy works with a drugstore. Every day we collect the prices of medicines in canadian pharmacies )|# buy viagra soft All goods when entering the pharmacy passes the test of "drug quality".