Wednesday, 18 October 2017

Motivation for and Usefulness of Computer Programs

Why write programs? Is it purely a hobby? Is it a series of boxes for us to tick for work or study? Is it to show how clever we are?
For myself one major attraction to programming is the ability to create electronic tools that help me do things with data. I like to think that the code is not an end in itself but the way we get the results we want - whether that is entertaining, interesting or useful for some further purpose.
There is an essay/paper on software development called the Cathedral and the Bazaar by Eric S Raymond (link here). Throughout it he highlights a series of principles and lessons which I have found useful guidance. The very first one is:
  1. Every good work of software starts by scratching a developer's personal itch.
Although not always true for my programs (some of them are about investigating a new part of Python I've discovered or been told about), it certainly fits quite a few of my programs. It reminds me of a description of computer programming as "constructive laziness", creating something so you don't have to do so much work - it will do the work for you.   
In my mind there are a series of levels of usefulness of computer programs:
  • Stuff you could do in your own head. Imagine the words "Hello World". Okay, so why do you need to print it out? Or what's 2+3? If you need pencil and paper (or a Python program) to work that one out, maybe Python programming isn't for you. 
  • Stuff you can do with paper and pencil. What's 32 * 23? A few folks may well do that in their heads, but I need to work it out on paper. The answer is 736 by the way. What about using the Caesar Cipher? If all the letters are shifted one place forward along the alphabet, what is "J MPWF QZUIPO" when it is decoded? This is where computer programs may not be essential but can speed up processes.
  • Stuff you can do on office software. Spreadsheets, word processors, simple databases, email-managing programs and web browsers are so ubiquitous in the modern world that they are the first stop when solving problems or working on tasks that are too hard for pencil and paper. For loops in Python can be represented in a series of cells on a spreadsheet that reference each other. Similarly, the CSV files I've read and manipulated using Python can be opened on most spreadsheet programs. Heck, I'm impressed with whoever creates these, and very grateful as well. Whether I use these commercial programs or create a solution with my own Python program is often a matter of motivation and time. If I'm enthusiastic and have time to spare, I will have a go on Python. If I am in a hurry, or maybe the task is beyond my programming skill (which is often the case), I'll just open up the spreadsheet or whatever. 
  • Stuff you can do if you really know office software. This is a sort of follow-on from the previous type, in that if you can create functions in spreadsheets, can skilfully manipulate tables in word processors, do form letters etc. then you don't really need to write a Python program to do those things. If you know your spreadsheets, you could probably get it to create a D&D treasure generator. But if you don't, then programming the solution in Python can seem a reasonable alternative.   
  • Stuff that requires specialised software. These tasks are not easily solved on OpenOffice, MS Office or whatever you prefer. The solution may be out there in the wider world, but finding a trustworthy source that does not charge too much money is necessary. If I can do it in Python, then the time and effort spent learning Python really starts to pay off. Of course, that's a big if. 
  • Stuff where nobody else has created a software solution yet, and you can't do it in your head or on pencil and paper. This is where if you really want a software solution, you have to create it yourself (or maybe hire somebody else to write it for you, but then why are you reading this blog?). If you are not the only person to face this task, but you are the first one to solve it then you can make money from it. All commercial programs rely on supply and demand. If you are the only one supplying and there is enough demand, you could sell your work for a tidy sum - just look at the apps being created for smartphones. 
So is this the only reason why I do Python programming?
No. Actually, some of the reasons I offered at the top of this post are still valid. Programming is a creative process and can be quite satisfying. It stretches my mind and challenges me to do better. And it looks good on a CV as well.

No comments:

Post a Comment