Back to C

The difference between languages

We are struck by the great range of things included in the term “software.”

This past week we were involved in a discussion about computer programming languages.  The subject is one that arouses strong opinions, and we are happy to say it was a polite and respectful discussion, something that is not guaranteed.  Our tutor, as we’ve noted, has done a little work in Java; we have looked at a Python textbook; our astronomer has written a number of routines in C, but now uses IDL for most of his research.  That’s not an unusually wide range among programmers, but it does give us some background.

We think it’s safe to say that a programmer who is proficient in one language, upon beginning to learn another, is appalled by either or both of two things.  First, at how hard it is to do his favorite task: a few simple lines of one language can turn into an intricate mess in the other (if it can really be done at all); second, at how easy it is do something that is dangerous and really shouldn’t be allowed.  Thus programmers, being people, often show a marked preference for one language over another, not always supported by strict evidence.

One of our correspondents pointed out that languages have different purposes, and one should pick the one most suited to the job at hand.  Do your high-speed mathematical computation in FORTRAN (which is still in wide use, despite being older than almost anyone who will read this) or C; set up your GUI in Java or Python-Tkinter.  This is no doubt true, but we think programmers who are expert in many languages are rare.  In addition, there is the practical difficulty of using a variety of languages all together.  This is somewhat overcome by using a scripting language like Python, which can call up and control programs written in other languages.  (We’ve never done this, but may try it someday, just to see how it works.)

This idea reminded us that languages form a hierarchy.  C is a low-level language, with the programmer interacting closely with the details of the machine.  There is a great deal of control, but also many tasks to keep track of, and the implementation of a complex idea can be a large block of code.  Many things that Java does automatically must be done by hand in C.  In fact, Java and Python compilers (the software that takes your code and tells the computer what to do) are written in C, as is much of the Linux operating system.  It’s analogous to the difference between a manual and automatic transmission, but in extreme form; or that between a gauge and a warning light.

And the hierarchy extends further.  The GUI you’re using to read this is at least one level above Java or Python.  And below C is assembly language, whose practitioners we hold in awe, and at the bottom the voltage bias in each transistor of the NOR or AND gates in a tiny section of integrated circuit.

There are probably a few people who can trace the whole structure, from ones and zeros to a video-streaming browser.  But not many.

Share Button