Is Programming Science, Engineering, or Art?

Programming is a new profession. As such, it is still finding its footing. The curriculum in many colleges is called Computer Science. That carries a connotation that it is a field that studies computers as if they were naturally occurring phenomena. It implies that there is a right way and a wrong way to use computers and by studying them and conducting experiments on them we can discover the right way.

The truth is, Computer Science doesn’t study computers per se. It studies how to use computers to solve problems. For the most part, it studies how to write programs that are verifiably correct and perform well, making best use of the hardware resources available to it. If anything programming is an engineering discipline, not a scientific one.

But that leaves something to be desired in terms of putting an accurate label on programming. Engineering disciplines have a body of best practices that govern the development of new projects. Programming is more of an art than an engineering discipline. The developer imagines a system that could meet the requirements of a project they’ve been assigned to write. She implements it iteratively, addressing first one, then another of the requirement that she has been given.

Getting all the pieces of a significant program to mesh together is a challenge. It takes an inquisitive mind to try various ideas until a good solution is arrived at. And a good solution is probably the best you can hope for. Excellent solutions are few and far between. They take a talented programmer, a well specified set of requirements, and a lot of hard work.

The programming profession is so new that we haven’t got a universally recognized and agreed upon collection of best practices. That is probably because the field is so wide open. With software, you can model at different levels of fidelity. A great statistician once said all models are wrong but some are useful.

Programming is all about modeling the real world to the level of detail sufficient for your purpose. Model fidelity is a difficult issue to resolve. You need high enough fidelity to allow the model to predict the behavior of the real item being modeled. You probably can’t afford to exceed that threshold by much. Often it becomes an exercise in patience while you track down the hidden assumptions and flaws in the model.

We don’t have a checklist for producing good software. But, we do have experience and a growing literature of open source programs we can skim through to glean inspiration from people that have faced the challenge and produced a solution that they decided were eloquent.

I think it’s safe to say that programming is still an art with definite mathematical and engineering leanings. We need to take inspiration from scientist colleagues and use the experimental method to help us discover what works. But we should remain cognizant that we are not studying natural phenomena, we are building a tool that is by definition flawed (a model with perfect fidelity becomes indistinguishable from the item being modeled).


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

The Power of Words

People that make lists often find that they accomplish the things on those lists without even necessarily referring to them. It’s almost as if writing is a magic spell that bewitches your mind into completing the tasks laid out for it. That’s been my experience anyway.

I have a fetish for stationary which is a little bit weird because I have an even stronger fetish for digital devices. I guess the habits formed when you are young never quite go away. Because of this stationary fetish I have stashes of notebooks of all sizes and styles. I have little three by five inch notebooks that have lined paper in them. I have five by seven inch notebooks with grid lines, straight lines, and blank. I have notebooks with leather covers. And that’s just a sampling.

I don’t write in them a lot. Especially since I’ve had a cell phone, a tablet, and a laptop. I make my lists on whatever device is handy. But whether I make my lists with pen and paper or I save them in files on one or more of my devices, I often don’t look at them for quite a while, if ever.

The other day I found a list from ten years ago. I went down the list checking off items that I had accomplished. Out of twenty or so items on that list I had done all but two of them. And those became pointless after we moved five years ago.

I think the neurolinguistic programming people got it right. Your subconscious hears everything you say and takes it very literally. When you create a list, whether by typing it in on a keyboard or writing it out with a pen and paper, you are programming your subconscious.

And so this becomes a cautionary tale of sorts. Be careful not to put something on a list that you don’t really want to accomplish. As writers we know, or should know, that words have power. They transfer knowledge, emotion, opinion, in short they convey thoughts from one mind to another, Be careful with your words so that you won’t find yourself in a situation where they can be used against you.

Be kind with your words. They have the potential to change the world for the better, Don’t ignore their power, harness it. Inspire with them, inform with them, entertain with them for they will determine how people remember you.

I know this is true. It is how I remember my mother and father. It is how I remember my grandparents. It is how I remember my teachers and friends. And it is how those that are still around remember you.

Words are what set our species apart from others. Savor their magic. Revel in their sound. And use their power wisely.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Reinventing Yourself

It is easy to fall into a pattern. You get up, take a bath, get dressed, eat breakfast, go to work, come home, eat dinner, watch TV, and go to bed. Maybe things vary slightly from day to day but by and large one day looks a lot like any other.

There is nothing wrong with living that way but sometimes, you get to an age where you start to think about how many more of those days there are going to be. You consider the things that you have meant to do in your life and haven’t done yet.

Suddenly, the daily routine isn’t good enough any more. The job may start to lose some of its luster. You have to figure out how you can afford to make this change, especially if you’ve grown accustomed to a nice comfortable salary.

Chances are, the thing it is that you want to do with the rest of your life may not pay quite as much as your current job. For one thing, you probably would have to start as a junior level worker in your new profession. Or you might have to develop a whole new skill set, like how to operate as a freelancer or a small (read single person) business.

If you’re like I am, you didn’t pay too much attention to the business end of the deal. You concentrated on producing the product or service that your employer paid you to produce.

What you are contemplating is cutting out the middle man. Instead of making product for someone else to sell, you are making product to sell directly to the customer. If you want to stop and watch a TV show, that’s your prerogative. But that is not going to make you any money.

It’s a whole different mind set. Some people thrive in that environment. Others are like little lost babes, looking for someone to set goals for them and tell them what to do.

How do you find out if you are cut out to be a sole proprietor or a freelancer? Well, it’s probably a good idea to try it out first. Your employer may have a clause in your terms of employment that restricts you from engaging in certain types of business activities without their prior approval. Be sure that you honor any such agreement.

If your employer will allow it, give the new business a try. Take a week or two of vacation and see if you even like doing the think that you are proposing. See if you are good at it. See if there is a market for it. See if you make money.

If so, maybe take a leave of absence to see if the business is going to work out. Or, if your an old guy like me, go ahead and pull the trigger and retire. If you’ve got sufficient savings and a pension, you can afford to struggle a little bit before you find your ideal job. But most important, be sure to have fun.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

A Self Made Programmer

It has been a little over forty years since I first programmed a computer. I learned how to program by reading a book about it. The computer was a large timesharing system called Plato. The language was called Tutor. It was an apt name for a language intended to empower teachers to create Computer Assisted Instruction (CAI). Looking back I can say that the language was influenced by Fortran and BASIC. It included some features that were not available in any of the languages of that era. In particular it had a facility for posing an essay question which the machine graded by looking for relevant phrases that the author deemed central to the question posed.

I had been lusting after a personal computer for several years before I obtained access to Plato at Southern Illinois University in Carbondale where I was studying Cinema and Photography. I had an aptitude for math and science but a passion for making movies. I had read the article in Popular Electronics about the Altair 8800 personal computer kit. It’s six hundred dollar price was totally out of my means. Little did I know that the darn thing would do nothing without further investment in input output devices and serial cards. It was a real money sink but it was so alluring.

When I needed a job to support my new family, I joined the Army on the condition that I get the longest training available in the Army in computer repair. I correctly assumed that the longer the school was, the more they would teach us. Sure enough, they taught us to program a trainer that was loosely based on the PDP-8 in assembly language. Then they took us circuit by circuit, subsystem by subsystem, through the Burroughs mini computer that was the launch control computer for the Pershing missile.

While I was in school I started reading Byte magazine. It had articles that described both software and hardware that people were building in the exciting new hobby of personal computing. I read it with a passion. But when all was said and done it was like reading about bowling. Something was lost in the translation.

I spent two years in Germany. I drooled over the personal computers in the shop windows there but they still were more expensive than I could afford. A friend in my company bought a computer kit. It was what I would call a second generation personal computer. It had an 8080 microprocessor but it also had a keyboard and video generator. You hooked it up to a TV and it displayed text on the TV. I didn’t get to program it much. I don’t think I ever got a program running on it. But it was better than just reading about it.

When I got back from Germany, Commodore was selling the Pet computer, Radio Shack was selling the TRS-80, and Apple was selling the Apple II computer. It would be several more years before I would have my own computer but I found jobs programming until then. Mostly in BASIC. Always self taught.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

The Kentucky Long Rifle Demonstration

I had the extremely good fortune to spend three consecutive summers working in a western theme park as a gunfighter and a guitar player in the saloon show. The first summer was between graduating from high school and my freshman year at college. It was my first extended time away from home. I was paid seventy five dollars a week and a room to live in. The hours were long. We worked from ten in the morning until nine at night six days a week. The season started on Memorial Day and ran through Labor Day. The Fourth of July was always the most heavily attended.

In addition to acting in the gunfights, the gunfighters took turns giving a demonstration of the Kentucky long rifle. It was a thirty minute show that consisted of the presenter giving some of the history of the Kentucky long rifle while loading it with a blank round which he then allowed a member of the audience to fire. It made a loud noise, lots of black smoke, and impressed the ladies and children. Then the presenter would reload the rifle, this time with a live round, and attempt to shoot a paper cup full of water to demonstrate the destructive power of the weapon.

The cast of the town were mostly college students working to save money for school and getting experience as actors. Most of the gunfighters were not particularly outdoorsy. They were, for the most part, theater majors, good at memorizing lines and playing tough hombres.

Then there was Ed. Ed was a gifted comedian. He had pitch perfect timing. His comedy skits in the saloon show had people laughing until they cried. He was tall, about six three, and had long blonde hair. Now that I think of it, he reminds me of the actor Jack McBrayer.

One day Ed headed out to the back of town where we conducted the Kentucky long rifle show. Most of the rest of the cast were sitting around on the front porch of the saloon “dressing the town” as the producer who paid our salaries liked to call it. We were laughing and joking, waiting for the inevitable boom from the blank shot. When it came, it sounded a little louder than usual but we continued talking among ourselves. We knew that we had about another fifteen minutes before the end of the show when the audience would troupe back to the middle of town for a gunfight and a saloon show.

Antique Kentucky long rifles are valuable. In the interest of profitability the theme park management had decided to purchase inexpensive Italian replicas of the Kentucky long rifle. It was not unheard of for there to be incidents with them so we had several of them on hand. As we were standing on the porch talking one of the gunfighters pointed at the path from the Kentucky long rifle area. Running at full speed toward us was Ed. His hands and face were smudged black. Someone yelled, “Oh my god! Ed’s shot a tourist!”

In fact, he had not. In fact, the barrel of the cheap Italian replica had split with Ed standing right next to it as the tourist shot it. Everyone was no worse for the wear but after we determined that no one was hurt we all laughed so hard that we had to hold our sides. Ed’s timing had delivered a perfect slapstick performance once again.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Functional Programming Rocks

One of the mathematical properties of a function is that given the same input values it will yield the sam output value every time. In addition, there will be one unique value for every set of input values. This property is called referential transparency. A consequence of referential transparency is that when you compute the value of a function for a given set of input values, you can make a note of that output value and the input values (called memoizing) and the next time you want to know the value for that set of input values you can look it up. That is usually less work than computing the value every time you need it. Some functional languages are aware of this property and automatically memoize calls to functions that will benefit from it.

Another feature of functional languages is that they treat functions as first class elements. That means that functions can be passed as arguments to other functions. This is useful in creating higher level behaviors. For example, we can create a function called sort that accepts a function that compares two elements. Then, by changing the comparison function we can sort by ascending values with on comparison function, sort by descending values with a different comparison function, and so forth. We can even sort by several different attributes if you are sorting records. Basically your options are only limited by your imagination.

There is a technique that is often used in functional languages. It is called currying and is named after the mathematician Haskell Curry. When you create a curried function you define a function that associates fixed values to some of the parameters of a function. Then when the remaining parameters are supplied it returns the same value as would have been returned if all the parameters had been supplied at once. For example, you might have a function called “add” that takes the arguments “a” and “b” and returns the sum of “a” and “b”. You might notice that you often add 2 to other numbers. You could create a curried function “add2” that takes a single parameter “a”. “add2” adds two to “a” and returns the sum. This might sound like an odd way to do this but it gives the compiler opportunities to optimize the curried function. It also makes your code more concise and easier to read.

There are other advantages to functional programming. I’ll write about them in future blog posts. But I hope this post has piqued your interest enough to inspire you to look into functional programming. There are a number of different languages that offer functional features. If you are a fan of Java, you might check out Scala or Groovy. If you are a Python programmer, give Julia a look. I have been looking into Elm of late. It is an excellent introduction to functional programming.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

The Elm Programming Language

Elm is an impressive programming language. It has been around for five years. It is one of the group of recent languages that compile to Javascript. As such, it has been primarily used to develop web applications. But that is selling it short. It is more innovative than most of the myriad other new languages that have been introduced in the last five years and deserves far wider attention than it has thus far garnered.

First of all, Elm is a statically typed, purely functional language. It treats all values as immutable and has a module system that enforces semantic versioning. Function invocation is accomplished by writing the function name followed by the arguments of the function separated by spaces. There are no parenthesis around the arguments to a function or commas between them. Parenthesis are reserved for forcing grouping of elements.

Elm looks clean on the page. It is designed for creating reactive web pages and consequently has the Model, View, Controller paradigm built into the basic structure of its code. It calls the Controller function ‘update’ though which actually makes more sense. It has incredibly informative and helpful error messages. It enforces good program design at compile time, consequently there are virtually no run time exceptions to deal with. Any such exceptions that do arise come from the fact that it tightly integrates with Javascript, HTML5, and CSS.

I’ve looked for books on Elm but I have only found one or two. The best one is the Elm Tutorial which is available for free online and is a compendium of most of the other online documentation. The language is small and concise. There are a number of examples available to help the neophyte get up and writing their web applications in short order.

Elm leverages the Node.js ecosystem to do a lot of its heavy lifting. Consequently, it is easy to use the Electron package to develop desktop applications in Elm. What is left facing the developer is a clean, easy to maintain syntax that encourages expressiveness while rejecting unnecessary boiler plate. Although the language is statically typed, type declarations are optional. Explicit type declarations are useful to improve performance and sometimes to allow more expressive interface definitions though.

As far as expressing web pages in Elm, it is far easier to read than HTML. I plan to do some development in Elm and will report back when I have more experience with it under my belt. In the mean time, you can check it out interactively on the web at http://elm-lang.org/.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Etude

The heat was oppressive. The humidity was high. The air was still. The sun beat down brutally. It was August in the south but it was more extreme than he remembered it being. There was rain this year. That was better than the drought that had stretch until well after Christmas last year.

He dashed into the bookstore and breathed the blessed cool of the air conditioning. He made a bee line for the cafe and ordered a large iced coffee, black. He carried the drink to a table at the back of the cafe area and claimed a table. He took his laptop out of his case and started to write. There was hustle and bustle around him but it was unexpectedly soothing.

He limbered up with an entry in his journal. He used the opportunity to sketch out his plans for the rest of the afternoon. He would get fifteen hundred words in on the story he was writing. He wasn’t sure how long it was going to be yet. He was letting the story dictate its own parameters. Then he had a piece that he needed to edit. It had been sitting there for a couple of weeks while he let his subconscious ponder on it.

Writing was like cooking. If you tried to write according to a formula that you read in some book, the words came out dry and without spice. You had to let yourself live with a piece after you wrote it. Your conscious mind would move on to other things but your subconscious would continue to process it. When you got back around to it and reread what you had written it was often apparent what you needed to do to it to fix it.

A friend stopped to say hi. I hadn’t seen her in a while. We talked for a minute. She asked what I was doing. I told her I was recreating myself as a writer. She laughed and said she had tried to write and had given up after a couple of months. I smiled and said I understood. But on the inside I judged her. You can’t expect to develop the skills of a writer in a couple of months. I bet she had spent more time staring at a blank page than she had writing.

I remember that phase. I wanted to be a writer but I didn’t know what to say. I discovered that it didn’t really matter what you said. You just had to sit down and say something. You had to plant your butt in a chair and write whatever comes to mind until it is second nature. When you no longer think about the process of transferring your ideas from your mind to the paper, then you are ready to start guiding your writing into specific places.

She said her goodbyes and moved back into the forest of shelves at the back of the store. I finished my journal entry and started my days work. I mentally adjusted my word count goal up to two thousand words.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Summer Stock Theater

Once upon a time there was a theater on a lake. Every night except Monday night from Memorial Day to Labor Day a company of players put on a play in that theater. Sometimes there was a full house there to see the play. Other times there were only two or three people. It felt strange when a company of thirty or forty people put on a show for an audience so small. But they were dedicated thespians and they considered it an opportunity to demonstrate their professionalism and besides, they could use the rehearsal.

Every night after the show when the audience had gone and the players had changed out of their costumes and washed off their makeup. After the crew had swept the stage and put up the properties. The director, or sometimes the stage manager in his stead, would give notes to the cast and crew about the performance.

Sometimes, if there was something that needed some extra work, he would call a special rehearsal for the next afternoon before the show. Sometimes, when the cast and crew got out of line, as they were sometimes known to do, the stage manager would have to fine the offenders, according to their offense.

For example, their was one scene in the play where four of the actors, dressed in fantastic garb and supposedly representing the rampant rivers of the region, plagued the poor farmer whose bottom land was subject to flooding, at the behest of the spirit of nature that directed them. One night, the actors playing the rivers hid squirt bottles in their fanciful costumes and drenched the actor playing the farmer.

Everyone, including the actor playing the farmer, thought it was funny. Even, I suppose, the stage manager. But what it wasn’t was professional. The people in the audience paid to see a professional show, not a sophomoric comedy. Consequently the actors playing the rivers were fined. Not large fines, they weren’t paid that much in the first place. But fines large enough to insure that they would think twice before pulling a prank like that again.

To the eight year old boy that I was at that time, it seemed harsh punishment. To the adult that I am now, it seems a fair one. I miss those people. They were my extended family. I learned a lot about the ways of the adult world from them. Many of them are probably dead now. All of them are as old as I am or older.

The theater was torn down several years later. Now the memories of those magical times live on in the memories of the few of us that are left who lived through them. But the world is a better place for the art that we created.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Leading From the Rear

I remember a time when I was in high school. My father taught Speech, English, Theater, and other related subjects. He also usually produced the plays, one in the fall and one in the spring. Dad was what you might call strong willed and was noted for rubbing people, especially incompetent administrators, the wrong way. One way or another he had gotten crossways of the current principal of the school and to “punish” him, the principal asked one of the other English teachers to produce the spring play.

My dad was one of the best teachers I ever new except my mother but that’s another story. But he had carefully trained himself to be a Broadway stage manager. His teaching credentials were a concession to his father who had no confidence in his ability to make a living as a stage manager. When my father graduated from college he presented my grandfather with his diploma and said, “There’s my teaching degree. Just like you wanted.” He was then promptly drafted into the Army. But not before he married my mother and got her pregnant with me.

He spent his time in the Army in Germany, a good place to be considering the Korean War was winding down in South East Asia. He was assigned to a training company but was almost immediately sent on a temporary duty assignment to produce a variety show with talent pulled from the various units assigned to Europe. And what a show it was. I never saw it, of course but he often told stories about it as I was growing up.

The point I’m getting at is that producing a play is a challenging task. It isn’t something that just any English teacher can pull off. Especially not the one the principal assigned to produce the spring play. I consulted with dad to make sure that he wouldn’t take my participating in the spring play as disloyalty to him. He assured me he would not and encouraged me to go ahead.

So, having acted in plays and watched my dad produce them since the age of eight, I proceeded to manipulate the “faculty sponsor” of the play into producing the play I wanted to do, “Big Rock at Candy’s Mountain”, a comedy parody of Woodstock, complete with live rock music. I designed the set and lead the crew that built it. I pulled together a band that cleverly served as three different bands as each of the guitarists took turns leading the band under a different name. I played one of those musicians. It was a lot of fun. But it was successful because I knew how to produce a play and lead a cast and crew. In other words, in spite of the “faculty sponsor”.

Dad got back in the good graces of the administration the next year and went on to produce many plays at the high school. The other English teacher was more than happy to let him do it. And I went on to play a gunfighter in western theme parks during my summer breaks in college.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.