Is Programming Hard? How Long Is A Piece Of String?

Before you tell me whether you think programming is hard or not, do you even know what you're talking about?

Is Programming Hard? How Long Is A Piece Of String?

I read an essay yesterday lamenting how many people are giving false hope to others by describing programming as easy. Programming is not easy! The author is quite concerned that far too many people are entering the programming world expecting things to be easy, and it's not easy at all. Wouldn't it be much better to be realistic with folks? Programming is hard, learning it well is hard, and if you want to be a programmer expect hard work.

This essay bothered me.

First, I'm still not sure a bunch of us weren't punk'ed. "Is programming hard?" is the kind of open-ended question that anybody who has ever programmed feels qualified to weigh in on. It's provocative. It's click-bait. It's an invitation to a lot of bickering where nothing really gets resolved. Programming is like art. Programming is like ice cream. Programming is like golf. I love programming. I hate programming. Programming ate my grandmother. The amount of feedback you can get from the net is almost endless.

Let's assume for a minute that the author was serious. They don't believe that describing programming as easy does anybody any favors, and it doesn't describe the work as the average programmer sees it. It's setting people up for disappointment.

life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
It's APL. This line of code is easy enough, right?

Looking at the average programming shop, I can understand that. It's not unusual to see 30, 40, 50 or more separate technologies that a programmer should have some degree of expertise in to get their job done. On the other hand, everybody has encountered programming tutorials where the code looks extremely easy, extremely approachable. That's obviously not tough, so what's the point here? Is programming hard is like asking how long a piece of string is. Without context it's meaningless. So let's try asking some better questions so that we can agree or disagree about specific issues instead of just unloading our own personal experiences and feelings.

Shot from a recent hackathon shared online

Does programming have to be hard?

No. Programming can be anything from a few lines of BASIC script to a 2 MLOC+ codebase in C++. It varies quite a bit.

float ( * ( *b()) [] )();              // b is a function that returns a 
                                       // pointer to an array of pointers
                                       // to functions returning floats.

void * ( *c) ( char, int (*)());       // c is a pointer to a function that takes
                                       // two parameters:
                                       //     a char and a pointer to a
                                       //     function that takes no
                                       //     parameters and returns
                                       //     an int
                                       // and returns a pointer to void.

void ** (*d) (int &, 
  char **(*)(char *, char **));        // d is a pointer to a function that takes
                                       // two parameters:
                                       //     a reference to an int and a pointer
                                       //     to a function that takes two parameters:
                                       //        a pointer to a char and a pointer
                                       //        to a pointer to a char
                                       //     and returns a pointer to a pointer 
                                       //     to a char
                                       // and returns a pointer to a pointer to void

float ( * ( * e[10]) 
    (int &) ) [5];                    // e is an array of 10 pointers to 
                                       // functions that take a single
                                       // reference to an int as an argument 
                                       // and return pointers to
                                       // an array of 5 floats.
C++! Woot! Easy enough, right? (h/t codeproject for example)

Is most programming hard?

No. Most programming happens when nobody knows it's  programming. It's people using IFTTT, people creating spreadsheets, or people working online models.

Is being a programmer hard?

If you want a job of being a programmer, then it's very likely you'll end up in a very complex situation that will require lots of skills and the ability to think in-depth. If you want to accomplish something using programming, then it varies quite a bit. It depends on whether you're focusing on the tool, code, or the result, value.

Doesn't doing really valuable work using programming involve complex programs?

Surprisingly, no. The relationship between code and the value of the result separated quite early in the history of programming with the second-generation programming languages. As we abstracted away coding constructs, we declared which constructs were useful and which weren't. The ones we abstracted and automated were the ones we thought were useful and provided value. That made those concepts quite easy to implement.  The concepts that did not match up to the abstraction levels we created, say 3-D programming at the time DOOM was written, were extremely difficult for programmers to solve.

While the amount of value for the most part has nothing necessarily to do with money, we can use it as a rough proxy for our discussion. h/t Symbiotics

Higher-level languages and tools, oddly enough, provided a lot of pre-canned value at the expense of a lot of hidden and complex edge cases. That trend has only continued exponentially. So lots of things became trivially-easy, like drawing on a canvas on a web page that could run in a dozen kinds of browsers worldwide. But even more things became quite difficult, like debugging SAML across a complex worldwide network involving layered VPNs. The problem stopped being about results, like "let's share information and keep it from others" and became about the programs: VPNs, networks, and such.

	// Begin game init
	if (CurrentPlayer.isBeingRessurected()) {
		CurrentPlayer.carriedInventory.loadInventory();
	}
	else {
		CurrentPlayer.Walking.goToStore();
	}
Is this code hard? Who knows? It could represent something easy or something a thousand times more complex than what we've seen so far. Levels of abstraction allow us to work faster, but they also appear to be simpler than they are and hide what's really going on for the next coder.

For the most part, you don't get hired as a programmer to provide results, you get hired to implement all of these various kinds of tech that at some point has been predetermined to be necessary to provide results. If they predetermined you were going to use a bunch of really complex stuff, you've got a tough job ahead! If they made other choices, perhaps, the programming job isn't that difficult. For most all working programmers, the difficulty is not related to the value at all.

The metrics we look for, years-of-experience, languages, salary requirements, and so forth are only tangentially related to the job.

Doesn't that mean that anything you create that's truly valuable will also have to be so unique as to be difficult?

Also no. For most every case I've seen, and based on every expert I've heard, unless you're doing something wrong, programming should only be an extremely small part of providing value. Most folks I've read put it around 5% of the total effort. Turns out, the hardest part of making stuff people want is working through exactly what people want. That very well may involve technology, but it's creating and using technology in an exploratory mode. I'd argue that 95% or more of active coders have never been instructed on this or seen it happen.

Oddly enough, the logical conclusion here is that most programmers don't know how to program. Instead, they know how to create, maintain, and modify extremely complex pieces of programming logic deployed in sometimes byzantine ways.

== true false 0 '' null undefined NaN Infinity [] {}
true true false false false false false false false false false
false false true true true false false false false true false
0 false true true true false false false false true false
'' false true true true false false false false true false
null false false false false true true false false false false
undefined false false false false true true false false false false
NaN false false false false false false false false false false
Infinity false false false false false false false true false false
[] false true true true false false false false false false
{} false false false false false false false false false false
One of my favorite examples of programmers creating complexity where none was needed: evaluating whether something is true or false in javascript

So they're not the best people to be talking about whether programming is hard or not. They don't know. They've never done it.

Doesn't every program start off simple and then get complex? If so, then all programming ends up being complex, right?

To a point, yes. The key question you have to ask yourself is this: am I growing in complexity appropriate to the new features I'm providing? Most programmers don't know how to do this, either,  so we're back to where we started: new programmers are left to be dropped into shops with extremely complex programming environments and very little ongoing value being provided.

Death marches. Golden handcuffs. Soul-sucking  9-5 grinds.

This is just another example of the problems associated with the decoupling of complexity from value. It's also an excuse that sounds a lot like "shit happens" You can either be WhatsApp, providing value and servicing a billion users with 50 devs,  or you can be a thousand-person project that's never delivered anything and never will. Whichever that is, it has nothing to do with programming. That's all you.

We easily begin to replace being useful with being busy, most of the time without noticing.

The desire to actually do something useful, to actually program, probably explains the large number of programmers who have side projects. They'd like to actually work for a change.

What about cutting-edge stuff, like various forms of ML or new tooling?

Sure, there's always coding without regard for value, believing that the value will come later. While rare in the overall industry, that's a beautiful thing to do. Where would we be without meta-languages, cross-compilers, Big Data tooling, and so on? Somebody has to do this, and it's fun to do!

Deep Learning h/t The Data Scientist

The problem is that far too many programmers think they're doing this when, in fact, they're just constructing some Rube Goldberg machine that generations of programmers later will curse and bemoan. It's so much fun to do cutting-edge stuff that everybody's doing it, whether they're actually doing it or not. We easily forget that there's a huge difference between "cutting edge for the industry" and "cutting edge for me" and you get the same feeling either way.

Is programming hard?

Yes. No. How long is a piece of string?