Thursday, 13 September 2012

if (programmers = obsolete); replace();

I've been slogging at some phase vocoder code for the last couple of days, and pretty much picking out all the bugs.  Bugs in digital signal processing code, especially audio stuff, tend to make themselves heard,  which is good in many ways.

It's human to make mistakes.  It's human to be slow at computation.  But our brains are amazingly fast at some complex processes, just think of the incredible accuracy of (most of) our hand-eye coordination.  Our brains can also fortunately invent technologies and write code to reduce the effort of mindless calculation.

If you give a person a list of a million sums it will take them a while to do.  More importantly there will be errors; they might miss one or make a few careless mistakes, especially as they grow tired and extremely bored.  A computer will do a million sums in milliseconds, and with no mistakes and no complaints.

Although sums are a weak analogy, it also takes hundreds of people a fair amount of effort to write millions of lines of code.  In the code there will be human imperfections - bugs like in the code in the title, structural redundancy and inefficiency and so on.  If computers could write that amount of code in a few minutes, with no mistakes and highly optimised, think of the incredible power this would give humanity.  At the moment though, computers still have to be programmed by us.  Artificial intelligence is getting better though, and so far we've enabled computers to beat a chess grand master, compose like Bach, and talk to each other with their own language, among lots of other things I find mind blowing.  I think it's just a matter of time before we create a full simulation of a human brain, and start to debug our own minds. From there on it's only a matter of more time before we create a programmer's brain, and have a computer programming for another computer or itself.

Computers are of course already writing code, in a very limited way - compilers take a language like C's syntax and convert it to assembly, and in the process, a load of crazy optimisation goes on.  This is ideal, because it allows the programmer to go for clear and readable code, leaving out little efficiency hacks knowing the compiler will deal with it.  Another pretty cool thing is Visual Studio's "intellisense", which is kind of like spellcheck for programming.  It underlines errors with a red squiggly as they appear, and it lets me instantly fix little errors like semicolons as they appear.


It still feels like we're a long way away from a computer writing a program of any use, but then artificial intelligence still feels like it's in its infancy.  Reading "The Age of Spiritual Machines" has maybe given me an overoptimistic (but who knows?) view of the near future, but hopefully we'll at least see programming technologies making more and more possible, in terms of huge and reliable systems.  If computer computer programmers were to be invented, it would definitely raise some interesting social issues for the hundreds of thousands of programmers that have become obselete.  Ironically we will have created the technology that has made us redundant!

No comments:

Post a Comment