Thursday, September 10, 2009

The size does not matter

I've just finished a very inspiring conversation with a friend of mine and I want to share the outcome with the rest of you.

So it started quite innocent. He talked how he liked the Flex framework with some server-side code, I talked about the discovery of Apache Wicket... Just a normal conversation between 2 fellow programmers.

Then after some time he expressed his bad feeling about dynamic languages and all. Well, I've asked if he'd like to see the waves of a WiFi transmitter where he immediately replayed that he ain't got a microscope laying around....

At that time it was quite obvious that he thinks of them as something that really is there. That they are something he can take for granted. That's an assumption even if on a very theoretical level. He made an assumption and to that end he expressed his behavior as dynamic.

This fact lead to a conclusion that human beings are in fact in their nature more suited to the dynamic part of programming languages than anything else. We choose to think about programming as a very static thing whereas it is completely dynamic in its very nature. We can never predict what the user will give for an input to our carefully design form, do we? We can never predict what kind of weather condition will be fed to our application's flight planning routine - it's just a wild guess that we can cope with all of that.

On a more structural level it's a lot better to define the actual interface required for the part in question to work as expected than to say that this part must definitely be of some special type. Hell, the duck and a canary are birds and are similar in a lot of different ways. Did they evolve from the same species? Maybe yes but, on the other hand, maybe not. The fact remains the same that we can talk about the wings of a duck as well as of the wings of a canary and we all know that they move more-less up and down to create some lift to allow the bird to fly!

At the end of the day both ideas (the static and the dynamic one) have their advantages and disadvantages. It's just takes the openness of one's mind to realize the similarities and advantages of both solution to pick the right one for the job.

Happy hunting!

1 comment:

astachurski said...

Strongly typed languages definitely far more better are suited to model real-life situations. Real problem are enough complex and we make big mistake trying to model them using structures/languages/algorithms that are alike. Try to think like japanese - it's not enough to know their language! Dynamically typed languages bring about new sort of problems adding them to overall model's complexity...