Posted by satyak
on October 22, 2005 at 7:25 AM PDT
How in 18 years the code I wrote ran the first time.
Software consulting firms in India during late 80s enjoyed a rare advantage. The job market for graduating engineers in all disciplines was very depressed. Especially with regional language differences and the inability to communicate in English and in some case Hindi pushed many undergrads from the regional universities to pursue masters programs. As luck would have it, the central government instituted a scholarship (essentially a monthly salary) for most of the qualifying graduating programs. This further encouraged the migration to higher education. The poor job market and a very qualified talent pool provided a windfall for the consulting firms that had just started consulting in US and other countries abroad.
During those years I found myself sharing a cube with two more individuals at one of the consulting firms. One of these good friends is a copious programmer. He used to get quite irritated as the boss would demand his work sooner. His reason was that he might take longer but his code would run the first time. He was quite right in a good number cases. In contrast I might take ten runs before even compiling and then another ten runs to actually get it working. I have always looked upon a day when I would write code and it would somehow miraculously run the first time.
Well after all these years I have a small victory to report. Recently Pramod , a friend, asked me to provide a facility for him in Aspire/J2EE to set a parameter on every database connection he uses. So I have created this fairly involved facility based on "connection events" that did the following
- Raise event when a connection is created
- Raise event when a connection is closed
- Raise event when a connection is requested from a pool
- Raise event when a connection is put back into a pool
- Provide an event distributor so that he can override any events
- Provide a default event handler that can call an sql statement on all opened connections
I have also created a write up for him on my site on how to use the facility along with release notes for the jar file. I was gearing up to hear from Mahaveer , who is using this jar, all kinds of issues as I have not even unit tested the facility other than compiling it with eclipse.
Then I was talking to Pramod on a completely different subject and he mentioned the whole thing worked fine as he expected and Mahaveer is using it.
I am quite positive I may have to wait another few years for this to happen.