The Humble Programmer – Edsger W Dijkstra

I first heard of Edsger W Dijkstra in the context of agile programming.I was having a discussion regarding agile programming with some friends and explaining Test Driven Development and the concept of first creating tests that can prove show the correctness of the code before writing the code, when a friend mentioned that this sounded a lot like some of the arguments put forward by Prof. Dijkstra in his Turing award lecture in 1972. I found that hard to believe, after all, if this was known in 1972 then why is it only becoming popular now ?

So I started looking up Edsger W Dijkstra and realized that this man was one of the pioneering giants of software programming. He is the father of structured programming and one of the guiding heads responsible for much of the way we program computers today. There is a lot written about him all over the place – I shall focus on his Turing award lecture, that was titled “The Humble Programmer“. In this lecture, Prof. Dijkstra puts forth six arguments on the way software programming should be done. On reading these six arguments I cannot help but feel that this lecture was one of the main inspirations used by the authors of the agile programming movement and design patterns community.

The six arguments put forward in the lecture are as follows -

  1. “A study of program structure had revealed that programs —even alternative programs for the same task and with the same mathematical content— can differ tremendously in their intellectual manageability. A number of rules have been discovered, violation of which will either seriously impair or totally destroy the intellectual manageability of the program.I now suggest that we confine ourselves to the design and implementation of intellectually manageable programs. The programmer only needs to consider intellectually manageable programs, the alternative alternatives he is choosing from are much, much easier to cope with.”
  2. “As soon as we have decided to restrict ourselves to the subject of intellectually manageable programs, we have achieved once and for all a drastic reduction of the solution space to be considered. This argument is distinct from argument 1.”
  3. “If one first asks oneself what the structure of a convincing proof would be and having found this, then construct a program satisfying this proofs requirements, the these correctness concerns turn out to be a very effective heuristic guidance. By definition this approach is only applicable if restrict ourselves to intellectually manageable programs.”
  4. “The only mental tool by which a very finite piece of reasoning can cover a myriad of cases is called an “abstraction”. There are number of patterns of abstraction that play a vital role in the construction of programs. Knowledge of these patterns of abstraction are essential.”
  5. “A programmer is fully aware of the limited size of his own skull; so he approaches the task of programming in full humility and avoids clever tricks.”
  6. “The only solutionproblems we can solve in a satisfactory manner are those that finally admit a nicely factored solution.”

When you go through these arguments you see the seeds for the various movements in programming software today -

I really enjoyed reading his lecture – I have the lecture here (The_Humble_Programmer)  if you want to read it. He must have been an extremely engaging speaker – a lot of his quotes are available here.

Till next time – Happy Programming !

Update: I have made a couple of corrections based of some of the comments here.  When I wrote that argument 3 is the basis for TDD I meant that in the lecture Dijkstra talks about first finding the structure of a proof and then constructing the program satisfying the proofs requirement. This is similar to the TDD approach of first writing a test and then writing code that satisfies the test.

Learning Software Programming Takes Time

This comic created by the Abstruse Goose is one of my all time favorites.

It embodies my frustration at people who think that all  becoming a software programmer involves is learning a little computer syntax , reading a few books and typing out a lot of code.

The books that claim you can “Teach Yourself” X in Y “days/hours” etc are written by charlatans out to make a quick buck (I think sometimes it is the publishers that foist such titles on the authors in the hope to sell a few more copies). All they do is frustrate the people who are genuinely trying to learn software programming and provide PHB types with ammunition – after all if programming can be learned in X time then any schmuck who can read and knows a bit of typing should be able to become a programmer, at least by 2X the time.

Interestingly, no one writes a book on “Teaching Yourself” building a bridge or a skyscraper in X days – after all building construction is a popular metaphor in software engineering. The presence of these books are IMO a symptom of the ignorance that people have about what it takes to write solid software.

As this post points out – it can take up to ten years for an artist, researcher or a sportsman to be considered a master in his or her field. Software programming is no different.

What is TED ?

TED is simply a gathering of the remarkable minds to talk about and listen to ideas that they think are worth spreading.  At a glance these are the facts about this organization -

  1. TED started out in 1984 as conference bringing together people from three worlds : Technology, Entertainment, Design.
  2. It was acquired (in 2001) by a Non Profit – The Sapling Foundation. Under the foundation TED has evolved beyond a conference in Long Beach to a have global presence with conferences in US (TEDConference), Europe (TEDGlobal) and India (TEDIndia). The curator of the foundation (and the conference) is Chris Anderson.
  3. The scope of the conference has also become broader to include subject matter, to cover almost all aspects of science and culture.
  4. The conference is very difficult to attend and is by invitation only – in fact there have been claims that it is elitist and the folks at TED have responded to this claim.

All this is public record – but, IMHO what makes TED different is – the quality of the speeches and that they are publicly available on the internet.

The speakers at TED range from business tycoons like Bill Gates, Jeff Bezos, and Richard Branson to political figures like Bill Clinton, Al Gore and Gordon Brown to artists like Bono , Ze Frank and Frank Gehry (there are a lot more including Stephen Hawking, Jane Goodall, Nandan Nilekani, ….- you get the idea).  What moves them ? What excites them ? What do they feel is going to change the world ? These are the topics that they are invited to speak on for 18 minutes. There is a TED Prize – 3 winners are chosen every year from the conference and they get support from the TED organization for “One wish to change the world”. I guess there is something about the experience that seems to bring out the best from the audience, and the speakers, because the presentations made here are simply awesome !

The other aspect of TED and indeed the one that made me aware of them their potential is their endeavor to record and publish all the speeches on their website. The website was started in 2006 is constantly evolving with the latest social networking (Chris Anderson is on twitter) and awesome high quality video. This was what really made me go – whoa… and grasp the power of the conference. I suspect this is also what brought TED to the mainstream and captured the imagination of people like me, who would never have even heard of such a conference otherwise.

Some videos worth watching are -

  1. Hans Rosling – Best stats you have ever seen
  2. Pranav Mistry – Sixth Sense Technology
  3. Karen Armstrong – Charter for compassion
  4. George Whiteside – Postage Stamp Lab

There is some really inspiring stuff  here – I sincerely recommend that you bookmark this website and add it to your reminder list to visit on a regular basis – get motivated and inspired !!

, ,

Darwin gets a thumbs up from the catholic church

Here is the link – Vatican buries the hatchet with Charles Darwin

It’s over a hundred years too late but then this is the Vatican – it takes them awhile to get around to things :-)  I wonder what parents and school teachers will be telling their kids ;-) I can imagine the conversation -

Adult:  Remember that intelligent design stuff we were spouting about – turns out we were wrong after all.  My bad !
Kid: OK… Whatever you say…  Can I go and play now ?

Man, wonder what the die hard intelligent design folks will do – convert or accept the Vatican?
I’m going to grab some popcorn and watch the fireworks :-)

To all who had to experience ‘Performance Reviews’

In my career as a software developer (such as it is) I have worked in a couple of large IT consulting companies. Of all the drivel that I have put up with in those companies – ‘Performance Reviews’ and the energy expended on them was the one that caused most frustration. As usual Scott Adams expresses my feelings about this with so much more aplomb than I ever could…

Performance_Reviews

Feel free to agree or disagree with me – leave me reply…

Google’s latest move – Universal Search

I have been noticing some subtle and not so subtle changes happening over at Google for the past few days now. Google’s personalized home page has been renamed to iGoogle – search results has started appearing subtly different with new groupings and they had started putting more links in the classic Google Home Page. To illustrate what I mean check out this search for Jon Stewart – notice the bar showing all the different searches.

I was initially thinking, that this was simply another refining of the search experience and I thought I’d blog about it when I when I saw this announcement at the Google blog.
They have done, what – despite the looks of it – is a pretty big revamp…

Its called Universal Search – and it promises to be a merging between textual search and rich media search that should rock the search engine world and put even more distance between Google and Yahoo (Microsoft is still a distant third IMO). They are calling it the first move in pretty big re-design of their search engine, with a goal towards providing a universal search across all types of content – web, news, images, books, video, blogs, etc. This implies that now not only does your search entries return results for relevant web-links but also relevant new stories, books, blog entries and if relevant videos. From the UI point of view the user sees a white vertical navigation bar that groups the results by category. Vertical search companies better watch out – if Google can pull this off they are in trouble.

It finally reveals the strategy behind Google’s purchase of YouTube – more fodder for the search monster :-) Apparently not enough though since Google has also announced that their video search is going to search against the collections of other properties also.

Another major product or rather a new area is Google experimental. This is an area where new enhancements to the Google Search page is available for people to try out. I especially like the timeline feature and the keyboard shortcuts feature.

References :-
Search Engine Land
Google 2.0: Google Universal Search
Techmeme
http://www.techmeme.com/070517/p2#a070517p2

The DRM-Free bandwagon

Nowadays in the media industry, it is hip to be DRM Free. Witness the iTunes agreement and the Amazon announcement. What’s not to like – its a very “rising up against the man” thing to do and you get a lot of adoration from the masses to be sure…

Well as a consumer I think this is great but I also don’t think it’s the future and here is why I think that -
Mp3 as a format in my opinion is showing its age. To get lossless quality audio, mp3 files have to get pretty darn big. There are plenty of new and better formats out there both with and without DRM that do a better job compression and have better audio characteristics. Right now, this may matter only to audiophiles but they are still a proportion of the market which typically buy a lot of music. Based on this I believe that physical media is still going to be around for awhile but I also believe they need to undergo a price and quality adjustment.

Content itself is morphing – its no longer just music – its music videos, podcasts, video blogs, games, HD-DVD. All these content formats are typically longer and bigger than 5 – 10 minutes (the average length of a song) . They also have features that are not supported by mp3, so you are going to have to use new formats anyway. Downloading these files directly over the browser is going to suck for everyone except for those that have big broadband connections.

Both the iTunes and the Amazon announcements have talked about making unencumbered music available for sale. They have however not mentioned anything about the fact that this music is going to be bought and then shared over the internet. I might have missed the portion where they talk about using digital watermarking and if I did – someone please correct me. This does not address the fact that with todays technology it is really easy for someone to share a file indiscriminately with anyone and everyone on the internet.

I for one think digital watermarking should be used and advertised if nothing else as a deterrent. A digital watermark may not prevent me from sharing some of the songs I buy with my friend so he can hear a new artist but it would make me think before I shared it over a P2P network to the rest of the world since the file could be traced back to me. Of course the argument could be made that my friend could share it but if everyone knew the risk then they would share it only to friends they trusted not to do that :-)

References :-
Techcrunch http://www.techcrunch.com/2007/05/16/another-break-in-the-wall-amazoncom-to-sell-drm-free-music/

Download Squad http://www.downloadsquad.com/2007/05/16/amazon-announce-drm-free-digital-music-store/

Sharing information trails

Over the course of my browsing and blog watching I come across several really cool (IMHO) products and tools.

In the early days I used to bookmark them, but that didn’t work when I bought a laptop and started working on more than one computer :-) So I developed this complicated system of exporting and importing bookmarks till I discovered USB drives and that Mozilla Firefox could be made portable. But speed concerns and the realization that USB drives have limited write cycles drove me to looking for an on-line solution.

I used Yahoo bookmarks for awhile (now they have upgraded the tool and call it Yahoo My Web) but then I discovered Del.icio.us and I was hooked. I have used Del.icio.us since January last year and its only got better. It is, IMHO the preeminent social bookmarking tool out there, not only because of its clean spare interface but also because of it’s creativity. My Del.icio.us links are available on this blog on the right side below the pictures.

However Del.icio.us is blocked by the firewall at work and a friend of mine was asking me for ideas to share links with people, so I started looking again. I saw this tool (called Trailfire) today that looks particularly promising. Whats different about this website (other than fact that it can be accessed from work :-)) is that you can make comments and annotations about a set of web pages and create “a trail” about a particular topic – for e.g.: TiddlyWiki Trail

Update: Well, the powers that be at work finally decided that Del.icio.us is a legitimate and useful website after all and unblocked it a few weeks back. I have however continued to use Trailfire. I many ways I think it is a great complement to Del.icio.us. While Del.icio.us is great for quick bookmarking and for searching, its rather hard to put together a montage of links based on a theme like Trailfire. Trailfire has become my preferred tool when I want to bundle a set of links based on a particular topic. It makes it really easy and intuitive to share these links with other people, while also adding your own comments as to the content, relevance etc of each link.

My Internet revelation

Back when I started out in the world of software programming in India, the internet was just breaking into our consciousness. Broadband was available only in software companies and even there it was considered a perk. I came across an interesting article one day that made a few pretty bold predictions about the demise of telecoms. I read it and after awhile forgot about it.

About a month back I came across a reference to that article again and I read it once more and marveled at the author – David S Isenberg’s perspicacity.

Most of what he talked about has come to pass. Telecoms are just realizing that technology overtook them while they were sleeping and are desperately resorting to political arm twisting to maintain their profitability.

If you are interested in the internet and its evolution then this is definitely a great read.

The Art of Math

I’ve always had a love-hate relationship with mathematics. On the one hand I loved the concept, the premise of mathematics – to describe everything using a set of rules – on the other hand I hated the tedium of it… I loved to learn the concepts and theories, but I hated to sit down and do the sums, especially when there seemed no apparent point to it. That’s one of the reasons why I like programming – it allows one to solve to ‘real’ problems.
Because of this skewed view of math, I love to read about mathematicians and the applications of mathematics even though I suck at it :-)

When I saw this article on Slash-dot today I was immediately intrigued. It deals with one of the more infuriating concepts of math for me – Prime Numbers. A prime number is a number that can be divided only by itself and one. The infuriating part is there is no apparent pattern to prime numbers – you had to memorize them!

According to the article there is a correlation between prime numbers and the energy levels in the nucleus of a large atom. Excerpts from the article:

“Riemann discovered a geometric landscape, the contours of which held
the secret to the way primes are distributed through the universe of
numbers. He realized that he could use something called the zeta
function to build a landscape where the peaks and troughs in a
three-dimensional graph correspond to the outputs of the function. The
zeta function provided a bridge between the primes and the world of
geometry. As Riemann explored the significance of this new landscape,
he realized that the places where the zeta function outputs zero (which
correspond to the troughs, or places where the landscape dips to
sea-level) hold crucial information about the nature of the primes.
Mathematicians call these significant places the zeros.
But then Riemann noticed that it did something even more incredible. As
he marked the locations of the first 10 zeros, a rather amazing pattern
began to emerge. The zeros weren’t scattered all over; they seemed to
be running in a straight line through the landscape. Riemann couldn’t
believe this was just a coincidence. He proposed that all the zeros,
infinitely many of them, would be sitting on this critical line—a
conjecture that has become known as the Riemann Hypothesis.

But what did this amazing pattern mean for the primes? If Riemann’s
discovery was right, it would imply that nature had distributed the
primes as fairly as possible. It would mean that the primes behave
rather like the random molecules of gas in a room: Although you might
not know quite where each molecule is, you can be sure that there won’t
be a vacuum at one corner and a concentration of molecules at the other.

For mathematicians, Riemann’s prediction about the distribution of
primes has been very powerful. But despite nearly 150 years of effort, no one has been able
to confirm that all the zeros really do line up as he predicted.

It seemed the patterns Montgomery was predicting for the way zeros were
distributed on Riemann’s critical line were the same as those predicted
by quantum physicists for energy levels in the nucleus of heavy atoms.
The implications of a connection were immense: If one could understand
the mathematics describing the structure of the atomic nucleus in
quantum physics, maybe the same math could solve the Riemann
Hypothesis.

Mathematicians were skeptical. Though mathematics has often served
physicists—Einstein, for instance—they wondered whether physics could
really answer hard-core problems in number theory. So in 1996, Peter
Sarnak at Princeton threw down the gauntlet and challenged physicists
to tell the mathematicians something they didn’t know about primes.
Recently, Jon Keating and Nina Snaith, of Bristol, duly obliged.

There is an important sequence of numbers called “the moments of the
Riemann zeta function.” Although we know abstractly how to define it,
mathematicians have had great difficulty explicitly calculating the
numbers in the sequence. We have known since the 1920s that the first
two numbers are 1 and 2, but it wasn’t until a few years ago that
mathematicians conjectured that the third number in the sequence may be
42—a figure greatly significant to those well-versed in The Hitchhiker’s Guide to the Galaxy. It would also prove to be significant in confirming the connection
between primes and quantum physics. Using the connection, Keating and
Snaith not only explained why the answer to life, the universe and the
third moment of the Riemann zeta function should be 42, but also
provided a formula to predict all the numbers in the sequence. Prior to
this breakthrough, the evidence for a connection between quantum
physics and the primes was based solely on interesting statistical
comparisons.”