March 23rd, 2010
Programmer’s Block
Much is said about writer’s block, a condition in which an author is unable to produce new work due lack of inspiration. There are many theories about why the creative flow gets jammed and what can be done to let the stream gush again.
I have never heard somebody talk about Programmer’s Block before, but I know it exists because I experienced it. I went through a phase where my productivity as a programmer went down. I would sit in-front of my computer for hours staring at the monitor unable to produce any work. Every option I would think of would seem stupid or flawed. “O I know there is a better way to do this” I would tell myself, but the better way would not occur to me. Every piece of work seemed stupid, trivial and completely un-interesting. Suddenly doing anything other than programming seems more fascinating, like answering my emails, write documentation or go to a meeting. Afterwards I would feel bangs of guilt knowing that I didn’t put in an honest day of work. I would berate myself for being lazy, unfocused and stupid. Next day I would promise myself to double my efforts to be more productive. However the harder I tried the less productive I became. It was a very alarming situation and I had no clue how to address it.
The reason nobody ever talks about programmer’s block is because we don’t view programming as a creative activity same as writing or painting. Programming is supposed to be a science, where logic reigns supreme and any problem can be tackled by methodically following a set of steps. However programming is also a creative activity in which a programmer imagines intricate worlds inside her head that then gets realized on the canvas of ones and zeros. Like all creative activities it needs to be approached with reckless abandon. It requires courage to create something new where nothing was before. Intuition, state of the heart and spirit are involved along with the logic. Who knows about that crazy thing called inspiration, where does it come from? Why does it happen? Why does it stop? The writer Elizabeth Gilbert discusses some of her reflection on these matters in her Ted talk which I found interesting.
Today I realize that my programmer’s block had nothing to do with laziness, productivity or focus and everything to do with the state of my heart at the time. I started programming when I was 13, at that time playing with my computer was no different than playing with Lego blocks … it was fun. I remember in my first job after university feeling guilty about earning a salary, I was having so much fun in my job I would have gladly done it for free. I felt like I should have been paying my employer money for allowing me the opportunity to experience so much joy. Somehow many years later I was still programming, but it was just a job and I was doing it purely for money. I am glad today that I experienced the programmer’s block because it was my hearts way of telling me that something was missing. Forcing myself to do something for practical reasons just doesn’t work. I am a creative person. I am addicted to joy. I pray for inspiration every morning. I dream of creating beauty using my ones and zeros canvas. I am a computer programmer.
February 12th, 2010
The philosophical dilemma of an ancient geek
In the beginning, engineer created computer. And the computer was cold and bare. And so engineer brought computer programmer and separated hardware from software. Computer programmer looked at software and saw that it is fine and good. And computer programmer divided data and programs from the software. The data held values such as numbers, descriptions and dates. The programs held algorithms that told the computer what to do with the values. The computer could add, subtract and square root at speeds that nobody had seen before. All was happy and good in the kingdom of the computer and both engineer and computer programmer were happy with their creation. Then one day, more computer programmers came and there was big software with lots of values and lots of programs. Programs from one side were changing values on the other side. And programs from the other side were adding and subtracting values which no longer made sense. There was chaos in the values and programs grew more complicated and the programmers tried to fix them. Sometimes they would fix one side and break another. The engineer was angry and yelled at the programmers to stop breaking the beautiful creation made in his own image named computer. Fearing the wrath of the engineer, a group of smart computer programmers got together and invented a new programming paradigm named – Object Oriented Programming hoping, dreaming and praying that they would be spared the tongue lashing in the future.
The fundamental tenant of Object Oriented Design is the idea of surrounding data with functionality. Data is never on its own separated from the functionality that manipulates it, instead each logical island of data is encapsulated inside the functionality that understands what to do with it.
I have been both blessed and cursed. Early on in my career as a computer programmer I had to program in a pure object oriented language called Smalltalk. I was a perfectly happy computer programmer, completely content with the programming languages that I knew at the time, C, Fortran and others. And then Smalltalk crossed my path
Applying Object Oriented Design concepts is difficult in .NET. This is due to the fact that the .NET Framework and tooling has been (along with prior Microsoft dev languages, frameworks, & tools) focused largely on what I call a forms-based approach to developing applications. The .NET developer customer base comes largely from VB and ASP worlds, where applications were large conglomerations of forms (or pages) with a bunch of code inline in the forms that serve to access and save some data from/to a database. The introduction of .NET as an “object-oriented” platform didn’t magically make all of that go away (and with good reason). So although .NET has object-oriented concepts built in, most of the tooling and a lot of the features of the languages and frameworks were and are targeted at those same kinds of applications.
This isn’t to pass negative judgment on Microsoft or all the extremely bright folks that work at that company. They had and have valid business needs to keep targeting this kind of development, partly because it really is RAD (rapid application development), and their primary dev customer base was (and is) used to that kind of development. I myself have developed using .Net for years, and simply got used to and accepted the .Net constructs.
.NET enables developers to have OOD constructs (classes, polymorphism, encapsulation, for example), but even with that, even with “class library” projects in the dev toolkit, it is still fairly difficult to develop OOD applications. Visual Studio 2008 has made it a bit easier and better with the class designer DSL (domain-specific language), but it is still fundamentally limited by the nature of .NET itself, and it is all too easy to fall into a way of developing applications that only pays lip service to OOD, one that uses things like classes, accessibility modifiers, properties, and methods, but is essentially forms-based and data-driven. I can’t think of anything that is more contrary to Object Oriented Design than using a DataSet to retrieve a bunch of data from a database and then binding the DataSet to a grid to display the information to the user and later to save it back to the database. Yet that is the easiest way to get things done in .Net and I myself have used it on many occasions, because resistance is futile and getting assimilated made my life less painful.
By “data-driven,” I mean that the average .NET developer (myself included) is so tempted to think in terms of database entities—to think primarily in terms of an object’s attributes (a.k.a., properties), i.e., its data members. Developers are encouraged to do so by many things. For most, their training and experience tells them to do this, and pretty much all of the purportedly OOD tools on the market today (including LINQ) do this—they all want to generate objects based on databases. Finally, there’s the simple fact that most enterprise business applications involve showing data to users and letting them modify it, so it is easy to fall into the data-driven mentality.
So the question I am asking myself is this. Is it possible to use OOD in the real world? And how to practically apply it?
September 1st, 2009
The dreams and nightmares of a geek
For years and years I have been working as computer programmer in the health sector. Developing software used by doctors and nurses in a hospital. The software helps reduce the number of medical mistakes made while treating patients. The fancy word for it is Clinical Decision Support, in plain English it means the software checks medications and treatments about to be given, against information in the patient chart to check for mistakes, for example an allergy to the medication, conflict with other medications the patient is already taking, … etc. When a mistake is caught, the software displays an alert to the doctor explaining what the problem is and suggests a more suitable treatment for the patient. A local hospital here in Vancouver, let’s call it Bringo Hospital (not the real name) uses this software.
I have a fantasy, more like a nightmare, it goes like this. Elen has a heart attack, 911 gets called and Elen is promptly transferred to the emergency department of Bringo Hospital. The fine doctors and nurses at Bringo run frantically to rescue the desperate case. The head doctor shouts order to administer 100mg of life saving medication. He types the “100 mg, life saving medication” in the computer counsel situated next to Elen’s bed and promptly gets back an alert stating “100mg life saving medication. Date August 16th 2048. Status pending. Appears to be outside of normal dose parameters. The acceptable single dose fitting this profile is 0mg”. The doctors and nurses look at each other trying to decide if they should ignore the software and administer the medication anyway, or perhaps there is a very good reason why the medication should not be given to this particular patient. A discussion starts, one camp states that the software should be ignored, the second camp argues that there are probably valid reason for not giving the medication. At that moment, Elen raises her right index finger, attempting to get the attention of the doctors and nurses standing around her. She opens her mouth, trying to speak, her mouth is paralyzed. “It is a bug, it is a bug” she wants to say, she can imagine the lines of code that had produced the alert. She can see clearly in her mind the exact line of code that has made the erroneous calculation. She opens her mouth to speak. “Beauoew, beauoew” comes out. All the doctors and nurses look at Elen with puzzled eyes, they have no clue what is she is trying to say. In frustration, Elen gives up on speech and tries to communicate through gesturing. Elen raises he right index finger again and starts point at the veins in her left arm. “Give me the medication”, she is trying to say, “stick the needle with 100mg of life saving medication into my veins”, she wants to shout. Nothing but unintelligible grunts come out of her mouth. Finally, the heart attack takes hold. Unimaginable pain pierces through her chest. With right index finger still pointing at her left hand veins, she drops dead. Elen becomes the first programmer to be killed by her own code.
The obituary section the next day states:
Elen Ghulam, the brilliant programmer and linguist who created some of the most inspiring software and who spoke 5 languages was last night betrayed by both programs and speech. RIP.
Remember bug 2000? Stories of pending havoc about to take place because of old software that only knew to calculate year in two digits instead of four. There we stories on the news of airplanes that were going to fall out of the sky on the turn of the century, nuclear rockets going off because of the faulty software and general chaos. I am a member of a younger generation of computer programmers that computed years in 4 digit numbers and hence was not a creator of any of the offending software, however the thought of software causing an apocalypse like state on earth intrigued me. Us, computer programmers, suddenly seemed so devastatingly important. On the eve of year 2000, I sat at home watching the news with disappointment. No airplanes fell out the sky, no cities shut down and there was no mass bedlam. Sigh! Who is going to take us seriously after that? The lack of a single year 2000 bug horror story, downgraded all computer programmers worldwide in status. We were no longer potential saviors of humanity, just average geeks who spoke a strange language that outsiders to our tribe didn’t understand. How disappointing.
My potential future tragic death scenario at Bringo Hospital aside, geekdom has been an experience of many pleasures.
I remember the job where I wrote software that enabled text entry in different languages. The hardest part by far was implementing the text entry in Japanese. Japanese is a language that takes years and massive dedication to learn, but I only had a few weeks and so I learned enough about the grammar of the language the different characters to allow me to implement the software that I was required to do. Here I was implementing software that I myself didn’t fully know how to use. Then came clients interested in purchasing the software. People working for the leading provider of Japanese text editors in Japan, where on the conference call and my job was to demonstrate the software to them and answer all the questions. After the conference call meeting, the people at the other end asked me if I could send them a trial version of the software so that they can try it themselves before purchasing it. “I will send it to you with instructions on how to use it within the next two hours” I answered with a confident voice, attempting to the best of my abilities to mask my trepidation. I knew I was able to fool our clients in Australia with this software and our other clients in California. But here I was an Iraqi living in Israel selling Japaneseness to the Japanese themselves. “There was no way I would be able to fool them” I thought to myself as I wrote the email with instruction for download and usage. My hands trembled with fear when I clicked the “Send” button. I visualized the Japanese software engineer rolling on the floor laughing his head off as he used my software. “This isn’t Japanese! This is mumbo jumbo!” I imagined him saying to his superiors when asked about the software that I implemented. Two weeks later the head sales man informed me that the Japanese text editor company signed the purchase order and were planning to integrate the software that I implemented with their product. I nearly fell off the chair from shock. “I guess this software really works if even the Japanese are willing to use it” I thought to myself with surprise. Nobody is more surprised that the developer when software functions as expected. I felt mighty proud at the little creation that came from my own very fingers.
I remember my first job as a professional computer programmer. I couldn’t believe that I could spend the whole day playing on my computer and somebody was willing to pay me money for it. It felt almost sinful to be making money while having so much fun. The pleasure of building software from scratch is similar to playing with Lego. Where you get to use your imagination to build things that didn’t exist before. Only with software you get the satisfaction of seeing people use your creations.
However with years of experience, also came failed projects that felt like a kick in the stomach, office politics that felt like a bad viral infection and people in suits that talk about investors and profit margins. Cynical and jaded I became.
Few months ago I found myself in a duty free store in Amsterdam airport aimlessly browsing at the shops to waste time. When I saw a shop selling a SWAROVSKI Crystal pendant that is also a USB memory stick. I started to jump up and down with excitement. “Oh my God! Oh my God! This is so cool.” I said to the sales woman in the shop. “They are making gadgets for women geeks” I continued with unconstrained enthusiasm. After viewing the pendant I make an impulsive purchase decision. As the sales woman was wrapping my pendant, she asked with puzzlement “Can you please explain to me why this is cool? What does it actually do? Every once in a while a woman walks in here and starts saying: Oh this is so cool”. So I began to explain to her that this thingy can be attached to a computer or a laptop and you can transfer you files to it and then you have your files with you all the time but it is also a heart shaped pendant which makes a statement about the love you have for these files. The elderly woman still looked puzzled and asked me “So why is that cool?”. “Well it is cool because you have your files with you in a heart shaped pendant hanging on your chest, which means you love your files and your digital files are important to you and you have them hanging right next to your heart, which says something” I tried to explain. “Aha” she replied, but she didn’t look very convinced.
It was at that point that I realized that I need to go back to building software that I loved and that made my body shake with fear when I was showing it for the very first time.
July 23rd, 2009
Love Hate Relationship
You see them everywhere. Sitting at their desks, staring at the monitor, murmuring incomprehensible words to themselves. I am talking about computer users. Walk around the office and ask your coworker “what are you doing?”. The answer will frequently be “Writing a document, sending an email or gulp! Installing software”. But what are you really doing, what are you trying to achieve, communicating with a customer?, planning for the future?, learning something new? or solving a problem?”. It seems that computer use has become a purpose on its own.
Busy, busy, busy, I am checking my email, but what have I accomplished?
How many times have you heard somebody swear while using his or her computer? “Damn this software!” a person might say in exasperation. As a software developer involved in software deployment; I had to experience the disappointment associated with showing the user, software that took many late nights to construct, only to be faced with yawns or worst, frustration. What started as a cool idea or a cutting edge technological breakthrough turns to a nightmare when installed on a customer’s computer. People don’t care about technology; they simply want tools that help them get their job done. For about 12 years I have been developing various business applications. Sometimes in a quiet moment when I close my eyes, I can hear a frustrated person swearing at me.
Recently, I watched my friends, a couple in their 60’s, buy a new computer. These are very intelligent people with many degrees and professional accomplishments between the two of them. I watched in horror as they tried to navigate through the maze of technical mambo jumbo and figure out what goes where. This is a couple who wants to write emails, edit documents and browse the internet a bit. Sounds fairly simple. I got many late night phone calls that started like this:
“I don’t know where my email went.”
“A dialog keeps coming up that says are you sure you want to download a plugin, should I click on yes or no?”
“I saved my document and now I can’t find it.”
“The anti virus is removing my attachments, but I need to read those.”
I went over to their place explained technical jargon and told them which dialogs to simply ignore and which ones they should take seriously. In the back of my mind I kept thinking, “My god! this must be overwhelming”. The worst part was the look of confusion in their faces. There was a sense of defeat, like this is too complex and we can’t figure it out. I felt a bit of guilt for having participated in developing this jungle of software mess. This monster that makes intelligent people feel stupid. After about two months of dedicated effort on my friends’ part, they are cruising on their computer taking full advantage of its many features, but after what turmoil.
The problem with computers today is that there is too much technology involved in its usage. To perform the simplest tasks on a computer you need to understand terms like HTML, HTTP, PDF, format, upload, server, database and many others. Imagine if Steven Spielberg had to know the internal workings of a Camera before he was able to make a movie. Imagine if he had to sit around while a technician was fixing the camera, or even worse, if Mr. Spielberg had to open up the Camera and fix the electrical parts himself. We wouldn’t have masterpieces like E.T. or The Color Purple. You don’t need to be an electrician to use a camera; you simply click on a button and start shooting. Getting too involved in the technical details bogs down the creative process. What masterpieces are we missing out on, in the digital world?
I think we software developers should dedicate ourselves to freeing people from software, so that they can focus on their work. We need to build a set of technologies that adapts software to people, rather than expecting people to adapt to software. We should create the camera effect for software. Software that does what its supposed to do while blending into the background without making too many in your face demands.
One day you will walk into somebody’s office and see a person, rather than a big monitor.
Ok, I have a confession to make. I hate technology. I suffer from technology phobia. How I ended up being a computer programmer is a mystery to me. The computer geek that hates technology. I am a luddite in disguise. But, then everything in my life is psychotic so why not my career.
I still remember the first computer I got when I was 13 years old. It was apple
IIe. I could use assembly to program it or a software designed to teach kids to program called logo. I was hooked. What started as a hobby ended as a career.
I remember my first job straight out of university. I thought I was in heaven. I got a desk, a computer, manuals, I could play on the computer all day long and the best part was that I got paid for it. WOW! that is so cool. To do the thing that I would have loved to do for free and get money for it. Plus, now I was writing software that other people were using. That is 10 times cooler than those university projects where you wrote some software to be marked by a professor and thrown away. The joy of creating a complex virtual world and then creating it from scratch. Programming to me is like playing with lego blocks. You imagine something in your head and then see it come to life and finally you get the satisfaction of seeing other people use it.
People ask me how I can sit in front of a computer for hours. “Isn’t that boring?”, they ask. If only they could see the vivid, multi colored world in my head while I am doing that. They would realize that my job is only as boring as my imagination is.
And then the internet came along. There was so much anticipation so much potential. This was the technology that would transform human kind. Most of it has been a huge disappointment to me. I read somewhere that 70% of all internet use is related to pornography. We have a medium that allows people in India to communicate with people in Portugal in real time. We have a medium that allows people to express themselves and exchange ideas, yet most people choose to use it for fake sex. I can’t believe that people are giving up on experiencing the real thing. The human race is doomed. I can’t believe the people that spend hours and hours surfing the net, most of what is on the net is garbage, what is there to surf about? What a colossal waste of time. Now we have cyber friends, emoticons for fake emotions, we send emails instead of having a straight discussion with a person. I have helped to create a monster.
Get rid of the cell phone. Don’t send an email. Go have a chat with somebody, not in a chat room, but rather by meeting them face to face. Look them in the eyes as you speak, notice how they smile. No software will give you that.