[tpm] Complexity and language

arocker at Vex.Net arocker at Vex.Net
Mon Jun 4 07:48:04 PDT 2012


At the last TPM meeting, I raised the question of complexity in
programming, and how to classify it.

We learn human languages by starting with simple, immediate, concepts,
(Food! Potty!), and gradually expand the physical, temporal, and
conditional dimensions that can be expressed; "If had eaten, and drunk
four coffees three hours ago, I might want directions to a suitable
facility". Given the known limitations of short-term memory, "chunking"
entities into suitable classes, (metals, ferrous metals, ceramics),
becomes important.

Programming languages like assembler aren't complicated; move a value to a
place, something is true or not. They're easy to learn completely, but,
lacking power, they leave the complication to the programmer to solve. If
the problem is basically simple, (measure a temperature reading, light an
LED if it exceeds 30C), that's straightforward. If the problem is to model
an economy, or render a graphic, it's a nightmare.

With a language as rich as Perl 6, many programmers may not need to
explore its full power, any more than a tourist needs to learn how to
discuss philosophy just to get a meal and a bed. Training will need to be
divided into levels, from basic to philosophical.

The question is, what is a reasonable hierarchy of complexity in computer
programming? (I hope the concept of "complexity" is fairly obvious in the
context; if not, we'll have to define that first.

As a starting point, I'd suggest the simplest useful level is programs
that take a stream of structured data and reduce or transform it in an
obvious way. That requires the basics, sequence, decision, and iteration,
I/O, classification, (e.g. isalpha), and formatting. (Roughly, Perl 4.)

Next is dealing with basic unstructured data, the ability to create and
manipulate more complex data structures, manipulating OS facilities beyond
simple file-handling. Object orientation begins to be useful here.

The most complicated non-research programs are "higher-order" ones that
deal with unpredictable (and untrustworthy) inputs, complex data
structures, (possibly unprecedented), and/or really elaborate outputs.
This would be the OS/compiler/scene-renderer/CAD/speech recognition level.

My experience runs out about half-way up the scale, so I could well be
wrong, missing subtleties, too fine/too coarse, or some unknown unknown.

Am I shouting into the void, or has anyone else any views on these points,
"what is complexity and what language features become relevant, where?"







More information about the toronto-pm mailing list