Solvay Conference!
I feel smarter just looking at this picture from the above mentioned conference.
I feel smarter just looking at this picture from the above mentioned conference.
Feynman succintly sums up how hard it is sometimes to explain technical details of any phenomenon in any science to a layman.
So yesterday, I was trying to do a simple MySQL query and realised that the value I wanted was of type text and the field I wanted was actually in the middle of the string and not always consistently there. So I decided to write up a script for myself which would do the DB query and then parse the string returned. As I had not done python for sometime, I decided to write it in python.
First things first, all I did was import MySQLdb. Nothing! Wasn’t installed. Fair enough. I had never had to previously install a python module, so I went to sourceforge and obtained the source, built it and it ran. That got me thinking, why do I have to do this myself?
I tried using go and even with the same import (mysql;), I needed to download the mysql module from google code and build it with the 8g and 8l binaries and then have a crack at it. Why am I still building these ???
If I wanted to do this in Ruby, I could use the gem installer and simply do a gem list -r mysql to find out which one was available and then do a simple gem install mysql-X.Y. No need to build. Installed and ready for use.
I like python and go a lot, but I believe for simplicity of use and for mimicking the behaviour of apt-get, ruby wins this one.
Of the languages that I have used in my professional career, Ruby is the one that makes testing easy and fun. It has an easy to understand testing framework and mocking out external classes, most of the time, is very simple. For example:
class Sauron
__def wants
____"the ring"
__end
end
def Gandalf
__def wants
____"peace"
__end
end
class MiddleEarth
__def who_wants_what
____if (Gandalf.wants == peace and Sauron.wants == "the ring") then
______return "war"
____else
______return "peace"
____end
__end
end
Lets say that we have to test out Gandalf or Sauron.
Gandalf.wants.should eql "peace"
Sauron.wants.should eql "the ring"
The above test code is called RSpec and is very simple and easy to understand. Whether it is a Business Analyst or a Project Manager or even your mother, she can fully understand the required behaviour or Gandalf or Sauron.
But what if we had to unit test MiddleEarth? Then we would have to mock Gandalf and Sauron together and alternately to test all code paths. RSpec makes that easy.
Gandalf.should_receive(:wants).and_return("something")
Sauron.should_receive(:wants).and_return("something else")
If either method of either class expected arguments, that too we can deal with.
Sauron.should_receive(:wants).with(something).and_return("something else")
So there you go, testing and mocking made inherently easy with Ruby and its testing frameworks. But how does it compare to the old language of Perl. Perl too, now has a very similar testing framework to RSpec, called Test::Expectation. And for mocking out external influences when unit testing, we have Test::MockObject and Sub::Override.
And if we wanted to business test in either language, cucumber can sit on top of both, although inherently it works much more readily with Ruby/RSpec.
Currently researching for tomorrow’s social hackathon.
I work in a young company. And by young, I mean the average age of my colleagues in Software Development is not more than 30 years. Before we went agile, our company had a policy of allowing people to work from home if needed. So all the young parents were greatly benefitted with this policy. The quality of work did not suffer and I think that was due to the fact that they were happier at home with young children and that was reflected in their work as well.
Then cometh the age of Agile!
We put proper emphasis on pairing (in my humble opinion, rightly so) and working from home from developers became harder and harder. QA had it a bit better because it was possible to do their work alone at times, but come time for estimation and writing features for a project, even they were not free. And while providing day care at workplace [ Day Care - An office affair and Babies at work ] is a possibility, it’s still a long way off.
So in the meantime, what do we do?
At our workplace, we have been provided with Macbook Pro’s for everyone. The default instant messaging client is called iChat, which comes with a provision to chat automagically on the local network, and ability to utilise the associated video camera. This I think, could be utilised to our advantage. Why does one need to be physically present while pairing? I don’t think you do. While the immediate presence of your colleague has the obvious advantages, the Agile advantages, I think, are more concerned with immediate feedback.
When you pair with someone, you want to ensure that both of you have some investment in the code being written: You can share the screen with iChat allowing both you (at work) and your pair (at home) to be able to play programming ping pong.
While pairing, you want immediate feedback if your pair has spotted a mistake in what you have done or that they don’t like what you have done: iChat enables voice support in conjunction with video.
I am not saying that it will be perfect. No new way of dealing with shortcomings in an existent methodology is, but we have to try. As a company, you have to ask yourself; in what ways do I get the best out of my employees? Keeping young parents in your company happy by allowing them to be parents and Agile practitioners (in that order), is one very good way to do it. And yes I know, I have specifically quoted Apple products in my example; that is only because I have experience with them. For dedicated linux users, you have pidgin/gAIM/Kopete. For others you have Skype/MSN/GTalk. All this is workable. We just have to have the will.
So instead of re-writing an entire web page handling system for myself, I go to my dreamhost settings and Voila! I see a way of setting up my own blog. Woohoo! And here I was thinking of setting a mail server somehow to inform me of the comments posted.
By the way, here is an interesting book I read some days ago, its called The Pigeon by Patrick Suskind. A pigeon throws a man’s life in disarray.