Friday, May 29, 2009

Is there Dijkstra quote on Java programming?

After about seven years I got into some serious programming recently.  The last time I wrote programs that mattered, was in 2002 when I worked for a start-up in a Seattle suburb.  Considering that the start-up didn't really get started, I can't say my work  mattered much.  At that time, it was a lot of C++, ATL etc.  I was getting wide eyed on things like annotation based programming and continous integration when I heard about the work in progress at Microsoft. The source of information was my co-worker who had quit Microsoft to find his fortune in the start-up.

Fast forward to last month.  I landed in San Francisco as an "architect"  (implied meaning: architect who would give lectures and do diagrams and do nothing useful) to kickstart a project.  Circumstances forced me to get into programming in Java with Spring and all that good things Java world is proud of.

I usually abandon learning when I go through the environment setup pains.   It was different this time.  I got to a quick start thanks to Lenny and Denis who set up the basic things functioning.  With the support of a good framework, my code was reasonably bug free until a change request came, when I tried to patch up the code in the last minute introducing a few silly bugs.

The typical development time issues I faced were mainly due to my C++ experience and MS conventions.  I tend to not see the parenthesis at the end of an if statement.  The operator = has an altogether different meaning.  Little differences like these made the development interesting.

The boring challenge was to have all the spring configuration entries for prototypes and singletons defined properly.  You miss one or misspell one, the application fails to start.  From the time you complete typing the core code to the time you get it to run, there is a big lag - thanks to the spring configuration.

Though I wasn't hands on before this project, I was in touch with software development as a discipline and was glad to use tools like liquibase, splunk etc.  These standardized tools make a programmers life a lot easier as compared to our home-grown solution for DB script management and log analysis in 2002.  I should say life is good for Java developers.... but for one question.

Isn't the Java world taking MVC a bit too seriously?  In an interview, I got into an argument with the interviewer on this.  We both agreed on the need for separating out the data, business rule and presentation.  I was fine having a separate function to take care of presentation details.  The interviewer insisted on having a separate class for presentation.  To close the interview on a smooth note, I listed the options in separating out the business logic from presentation.

Looking at the way Java applications are being developed, I wonder what Dijkstra would have said.  Though we have crossed the LoC way of measuring  programmer productivity, to me Java community seems to love the complexity.  Look at the packages and their nestings; look at the number of classes and interfaces created even for a small problem. And mindless accessor methods - a syntactic nightmare that C# carefully avoided.

I see design patterns, most importantly MVC becoming a religion preventing any rational design decisions especially on smaller projects.  I used to deal with a lot of SMEs that had requirements for a few months of development efforts.  Java projects typically got issues arising out of the complexity where the developers placed logic and presentation at wrong places.  We could blame it on the lack of training for the developers.  As compared to that, PHP as a platform for small projects worked exceptionally well.  

Sometimes, it is hard to tell the customers that your religion won't work!



Monday, May 18, 2009

In response to Science & Religion

This blog is in response to Ram's blog on Science and Religion, a debate.

I see both science and religion as two tools that try to set aside the subjective experience with a more objective observation.

I choose to place my views with examples.  I like examples.

If a religion preaches that attending a worship session is good for you, (medical) science preaches that aspirin is good for your heart.  Both tend to apply an observed phenomenon on a small sample to the masses.  Just as aspirin may be good for your heart, attending a sunday mass could be good for your emotions.  In both the cases, there are side effects.  Not attending a mass can induce guilty conciousness; aspirin is known to have side effects.  Note that I'm not referring to the act of attending the mass or taking aspirin, but am just referring to the preaching's impact.

Rarely do we see priests paying true attention to the individual.  Doctors are slightly better.  But considering the healthcare in most populous countries, I doubt whether doctors take individuals seriously.  Instead they try to interpret the situation with what they have learnt, in a scripture or a book.

Science gets an approval from the rationalists because it clearly has its fine prints and disclaimers.   Unfortunately, the religions I know of do not have such caveats.  Instead they warn of terrible consequences if you don't follow.  

Religion during Galileo's period disapproved of science that wasn't in line with the scriptures.  In a way, we see the same tendency within the scientific community of today, towards religion and spirituality.

Is there a serious study on religion or spirituality and its impact in the human well being?  If there were any, I doubt whether those researchers are respected within the research community.