On Programming and Programmers: The New People Of The Book

I learned recently that Muslims refer to both Christians and Jews as the “people of the book.” The book is the BIble.

Most programmers are now also people of the book, but of a different kind of book.

I’m preparing a talk on the lost art of programming in assembly language. As part of my talk I’m writing a Python program to serve as a simple test of Python performance.

In order to test numerical performance I decided to code two random number generators: one using floating point, the other integers.

I knew the algorithms involved, but didn’t recall some of the constants that are needed, as the poor choice of a constant can yield a bad result.

So I asked our friends as Google to look up “floating point random number generator in python” and “integer random number generator in python.”

Guess what I got? Reference after reference not to the algorithms, but to the calling sequence for various random number generators in Python’s vast library. Some folks were so proud they could find the Python reference manual on the web that they wrote blogs posts about it, when a simple search at Python.org would suffice.

Sigh…

Do most programmers no longer think?

Is an algorithm just a calling sequence?

Do most programmers have any idea how the most basic algorithms work?

Do they know the use of Taylor series? Newton’s method?

I doubt it.

I once did, and still remember much of what I learned several decades ago.

Believe me, I fully appreciate the value of libraries. I wrote most of the runtime libraries for LITTLE, the implementation language for SETL. I also wrote much of the runtime library code for several implementations of SETL. I also wrote the runtime for SPITBOL 6000, the port of Robert Dewar’s MINIMAL implementation of MACRO SPITBOL.

How many of today’s programmers have written the runtimes for a compiler, or other large piece of software?

The part I find most scary is what must be the near total ignorance of how floating point arithmetic works, and the limitations. For example, computations involving very small values occur in a strange universe where the change of a single bit in a 64-bit word can have dramatic consequences.

Even the people who build chips to do floating point arithmetic can make errors. See for example Pentium FDIV bug. [1]

Flawed computations used to make real-world decisions can have a profound impact. See for example The Urban Legend of the Upside-Down F16, with mention of an error in an early version of Microsoft’s Flight Simulator. See also Ariene 5 Failure, about how a software error caused a rocket to blow up.

I couldn’t find a floating-point generator easily so I decided to computer some Mandelbrot numbers instead.

I’ll publish the benchmark when it’s done, hopefully before I give the talk this coming Wednesday.

Advertisements

One Comment

  1. Posted May 4, 2009 at 19:03 | Permalink | Reply

    Dave,

    While much has been written on pseudo-random number generators, a classic basic reference is Donald Knuth’s “The Art of Computer Programming”, Volume 2, Semi-numerical Algorithms.

    I remember us jokingly referring to the Knuth set as the “Programmer’s Bible” so it is certainly an appropriate citation in the context of this posting.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Pages

  • May 2009
    M T W T F S S
    « Apr   Jun »
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • RSS The Wayward Word Press

  • Recent Comments

    russurquhart1 on SPITBOL for OSX is now av…
    dave porter on On being the maintainer, sole…
    daveshields on On being the maintainer, sole…
    Paul Tallett on On being the maintainer, sole…
    mrrdev on On being the maintainer, sole…
  • Archives

  • Blog Stats

  • Top Posts

  • Top Rated

  • Recent Posts

  • Archives

  • Top Rated

  • %d bloggers like this: