Favourite Quote :P

Justifications are the way of the world

Saturday, January 15, 2011

Programming?? Whoa!!

This one day I was trying to explain the concepts of computer programming to a civil engineering student. I was so lost ...  this girl wasn't getting anything at all. That was when I hit upon a new way of looking at programming. It is simple problem solving.

Consider this example. You are given a problem: 


What you have are the following:

  1. A list of numbers represented as myArray(1, 2, 3, 4, 5)
  2. You have only a certain words (and characters) to express yourself:
  3. while
  4. print
  5. "(" and ")"
  6. "{" and "}"

 etc .. (You would only need a few more).
Write down the steps to find the sum of all the numbers in the list, given certain ways of defining which steps are to be executed multiple times and so on.

If programming had been explained like this to me when i first learnt it, it might be that I would have looked at programming in a totally different light. :)