Pages

Showing posts with label ideology. Show all posts
Showing posts with label ideology. Show all posts

Sunday, 7 October 2012

The debate over Functional Programming

Yesterday, I attended the "Centenary of Turing Talks" Talk[4] at Persistent/Pune. After introducing Robert Milner's work, the objective was to decide whether _every_ programmer should learn functional programming. The debate, as with all human debates, digressed quite a bit. However the question remained unanswered. I am just giving an ardent attempt to answer this.

Details of the event are available at the following link:
http://www.persistentsys.com/About/Turing100.aspx

Summarizing the discussion and the points that were raised:
  1. Functional programming is a better abstraction and helps in thinking more about what 'needs to be' or what will be 'what is' ('is-ness' as Prof.Modi mentioned.)
  2. The best place to start learning Functional Programming would be Erlang or Haskell'98 (as Dr.Anuradha mentioned.)
  3. Starting out with monads and trying to run away from 'typed' variants is not recommended for those who are first stepping out into functional programming. (Dr. Anuradha) - (I have done this mistake, so I know this is true.)
  4. You could opt to write 'C Programs' with functional abstractions and Object-Oriented concepts like polymorphism. You could even do this with Assembly language - but that would be too cumbersome if a functional programming language already exists. (Prof. Modi) 

Everyone on the panel or otherwise knew functional programming and also knew that it doesn't get used in production.
  1. The reason functional programming gets lesser attention is the lack of digital infrastructure to support it.
  2. The "Harvard Architecture" in the market essentially assumes sequential code execution, thanks to Alan Turing's early papers. Hence concurrency is also another blocker as the architecture hasn't been rewritten to help that happen - not entirely mathematically despite the fact we have parallel processing, multicore computing happening.
  3. People start learning an "Imperative" language like "C" or "Pascal" or "Fortran" to begin with. Hence they get fewer opportunities that coax them to try out or spend time on functional programming.
  4. The switch usually has to be made at the cost of non-office times for a professional programmer, which leaves a shorter percent of time allocated towards it which is another factor that discourages people.
  5. Most people without a strong theoretical background in computer-science find it difficult to understand Object-Oriented Programming ... making Functional Programming more fringe. 
  6. Deterministic problems are seldom solved (in general practice) with functional programming as Structured programs are easier to verify and prove to be theoretically correct.

Thanks to more discouraging infrastructure factors to the more recent ideas of Functional Programming, Object-Orientation fused with Functional Programming; the 1967 creation of K&R lives on even today in production.

Recommended Reading

For Programmers you can find companies like:
http://www.janestreet.com/
http://www.helpshift.com/
who have a motto to do all their work exclusively on functional programming.

Friday, 20 January 2012

A message to Advocates against Corruption

(corruption index from 2010 ref: infographicsinsights.com)
It is true that corruption, bribes and inefficient governance have been the bane of India as it transitioned to a Republic. In the last five decades of independence, our growth has been stalled, primarily due to several internal factors. Corruption - the illegal use of office to build one's own wealth or empower the treasury is deeply rooted in history.

So here are some quotes on 'Governance' from the Arthashastra, written by Kautilya (translated, edited, published by L N Rangarajan {pp. 269 - 274} ) with the original written work dating to 150 CE, related to the Mauryan empire (c. 321 BCE - 185 BCE ). This work differs from an earlier translation by Kangle, which is more literal and does not attempt to add context to pronouns. Chanakyan, was synonymously used later with Machiavellian originally. This alternate name was born much later according to research. It is generally presumed that Kautilya and Chanakya are aliases.

Here are some sections, cut from the book for the enlightenment of the Reader.

"Special Levies, Taxes and Collections"

A King, who finds himself in great financial difficulty, may collect [additional] revenue [using the methods described below]. {5.2.1}

INTRODUCE SPECIAL LEVIES
 
On Farmers - usually requiring them to pay a third of their produce as tax or a varied proportion as the King may decree.

Force Compulsory Purchase - making the Government earn money on what the people may not want to buy especially in terms of food grains.

Levies on Merchants, Craftsmen and Professionals - Actors, Courtesans - 50% of their revenue, Fixed levies on Precious Gems, Precious Metals, other Liquids and Metals, Traders, Commodities like wood. 

Levies on Livestock Owners - for Cows, 10%, Small Animals, 16%, Cocks and Pigeons 50%
Miscellaneous - Prostitution being legal, Brothel owners shall on command of the King, send the youngest and most beautiful to collect additional revenue*.

Voluntary Contributions - All the Wealthy shall give as much of their wealth as feasible as the King demands.

Monday, 2 May 2011

Osama Bin Laden, Terrorism, What Now?

Today, President Obama announced to the world that Osama bin Laden, founder of the Al Qaeda has been killed in an operation led by United States Armed Forces personnel at Abottabad (District) in the North-West Frontier Province in Pakistan. Before the announcement the Social Media Network was afire with speculation of the announcement. The People of the world believe that the removal of Osama bin Laden is a key victory in the war against Terrorism - which is what the United States administration from George W Bush's government has been targeting. This also comes at a time when Obama begins a crucial campaign for a second term of Presidency. As the announcement came out, news channels were keen to point out that defense forces of the USA and several other nations  will be on full alert to watch out for any backlash from the Al Qaeda.

Does the assassination of one man spell a major victory over a political ideology that has troubled several nations worldwide? The answer at this point seems to be affirmative. The elimination of the leadership of the LTTE in Sri Lanka created a sense of victory to the Sri Lankan forces and a semblance of stability in that region. Despite that, a permanent humanitarian solution for the ethnic conflict in the island nation of Sri Lanka is  yet to be found.

As President Obama reminded his audience of the resolve of his people after the infamous 9/11 attack - he definitely conveyed the opinion that elimination of one man, who masterminded several terrorist strikes that threatened civilians worldwide, an apt counter strike, akin to a victory in open war.

True change however will have to come as secular and inclusive ideology in countries where this ideology has been threatened - particularly by terrorist & extremist elements. Each country will have to respect the people of other countries in settling their own internal disputes. At this time there are several countries including Libya where their is internal turmoil threatening the stability & being of those nations. Despite what everyone may say, humanity has shown that concerns for people go beyond borders. As this influence beyond borders can only increase, people and leaders need to take great care in exerting their influence to initiate any change.

Here is another pragmatic, rather skeptic view of the claimed "triumph" - http://www.cbc.ca/news/world/story/2011/05/02/neil-macdonald-osama-bin-laden.html